Oracle driver(8.1.6) connection pool problem in current users.(Logical
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   sundar_manyapu
Posted On:   Thursday, January 24, 2002 06:07 AM

To connect to the database i wrote a class which i called as DBManager which i made singleton class. In the constructor of DBManager i created OracleConnectionPoolDatasource(ocpd) and pooled connection object. From the pooled connection object(javax.sql.PooledConnection), the first user could able to take a connection object.(Logical). Using the connection object first user did a database operation. After operation he waits for 10 seconds(say) before he can go for next operation. In the mean time another user accesses the database does the database operation and closes the connection. Now the first user finds the connection is lost when he comes for the databse access.(Logical handle no longer exists)??? Why thi   More>>

To connect to the database i wrote a class which i called as DBManager which i made singleton class. In the constructor of DBManager i created OracleConnectionPoolDatasource(ocpd) and pooled connection object.



From the pooled connection object(javax.sql.PooledConnection), the first user could able to take a connection object.(Logical).



Using the connection object first user did a database operation. After operation he waits for 10 seconds(say) before he can go for next operation. In the mean time another user accesses the database does the database operation and closes the connection.



Now the first user finds the connection is lost when he comes for the databse access.(Logical handle no longer exists)??? Why this happens so?



I could able to find the reason to this behavior as the two users have two different references.


Kindly let me know your view on this. Can someone clarify on this???


Thanks in Advance.


Regards,

Sundar    <<Less

Re: Oracle driver(8.1.6) connection pool problem in current users.(Logical

Posted By:   Moushmi_Banerjee  
Posted On:   Friday, January 25, 2002 09:47 AM

Is your code thread safe ? It seems that both the users are getting the same connection object as opposed to two distinct object.

Try synchronizing the code and avoid sleeping for 10 seconds.
About | Sitemap | Contact