tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From QM <>
Subject Re: Access Threads informations/state
Date Thu, 10 Mar 2005 19:58:42 GMT
On Thu, Mar 10, 2005 at 08:47:25PM +0100, David Causse wrote:
: 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).

Is there a way to refactor your app, to move the thread-safety outside
of the Connection objects?   Put another way, it sounds as though you
could insert a data layer between the Filter / Session objects and the
Connection objects.

: 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().

The problem you may run into, long-term, is that a Java webapp isn't
supposed to rely on container-specific features, especially something as
low-level as the thread model.  

I don't see a quick solution to this.  Just about anything you find
right now will be a short-term holdover, and will eventually bite you
down the line.  If at all possible, consider refactoring the data access
of your app such that this isn't an issue.



software  --
tech news --

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message