dcsimg
Concurrent RMI calls generate EmptyStackException on one or more clients
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Fredrik_Duprez
Posted On:   Wednesday, July 4, 2001 06:23 AM

Hi, We have the following setup: Oracle 8.1.7, Windows and Linux clients running JRE 1.2.2_008, RMI server running on Linux or Windows NT with JRE 1.2.2_008. The RMI server uses thin JDBC to communicate with the DB. The RMI server creates a new impl-object for each client request. When several clients execute the same remote method concurrently, sometimes one or more of them gets an EmptyStackException. We've tried to synchronize the method with no apparent change in behaviour. One method where we seem to succeed is one where the database call can be executed once, storing the result in a static variable. Question one: Which stack is empty???    More>>

Hi,



We have the following setup:



Oracle 8.1.7, Windows and Linux clients running JRE 1.2.2_008, RMI server running on Linux or Windows NT with JRE 1.2.2_008.



The RMI server uses thin JDBC to communicate with the DB. The RMI server creates a new impl-object for each client request.



When several clients execute the same remote method concurrently, sometimes one or more of them gets an EmptyStackException. We've tried to synchronize the method with no apparent change in behaviour.



One method where we seem to succeed is one where the database call can be executed once, storing the result in a static variable.



Question one: Which stack is empty???


Question two: How can we solve the problem?


Question three: When we changed the JRE on the server to 1.3.1 we haven't been able to reproduce the error. Is there a significant difference between 1.2.2 and 1.3.1 in this case?



Thanks,



Fredrik

   <<Less

Re: Concurrent RMI calls generate EmptyStackException on one or more clients

Posted By:   Pontus_Strand  
Posted On:   Thursday, July 5, 2001 02:04 AM

Hi,



The problem has now been solved. It was caused by a bug in Oracle's thin JDBC client version 8.1.6. So the answers are as follows:



Q1: We use OracleConnectionCacheImpl.getConnection in our connection pool, it obviously keeps a stack of connections or something along those lines. This stack gets empty on occasions.



Q2: This bug seems to be fixed in version 8.1.7, at least we haven't been able to reproduce the problem.



Q3: We still don't know why it worked using JRE 1.3.1 but we think it is because it is faster and we therefore got some extra time before the EmptyStackException occurs and we didn't use enough clients to have any problems.



We probably would have found the reason for this much earlier if we had caught the exception on the server instead of on the client. Oh well, you learn by your mistakes :-)



/Pontus
About | Sitemap | Contact