Hi,

I store my jdbc connections inside the user session, and I create thanks to a Filter one connection per thread (cause we encountered multithread issues with the oracle JDBC driver, and we use frames).

When the user hit the "Home" link I have to clean all the session attributes, but I don't want to clean the Connections if they are in use.
In normal condition and in a perfect world no Connection should be present in the session when home is called, but it is a very big app...
The session attribute name is like "Connection"+Thread.currentThread().getName().


So when hitting home I loop over all attributes in the session and I do special case for each type of class I find. So when I find a Connection object I first have to close() before gc.
I know wich Thread generated this Connection (I can easely extract the Thread name) and I would like to close it *only if I'm sure that this Thread is not serving something*.


This case should happen because there is some big db extraction that the user can open inside a sort of popup and continue working on the main app screen waiting for the export to finish.

I identified 3 solutions to solve my problem :
- Do not close a java.sql.Connection if there is still open Statement on it - I don't know how to do.
- Ask tomcat if the thread is serving a request - I don't know how to do.
- Never close Connection - I don't like this one...


We use :
- JAVA 1.4
- Tomcat 5
- Oracle 9i with jdbc thin driver with our own connection pool management.

Thank you for you help.

David.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to