On Wed, 18 Feb 2004, Matt Feifarek wrote: > The crucial subtlety is that a thread does NOT destroy/garbage-collect > its servlet instance after servicing the request. Rather, the servlet > instance is "put to sleep" and kept around in case another request is > for the same servlet. If the application is taking requests for many > different servlets, the servlet instances do slip in and out of the pool > as different requests come in, but there is no guarantee that a servlet > instance will be brand new with every request.
It sounds like a servlet can re-awaken in a different thread from the one in which it was put to sleep. If that happens, changes made before sleeping get registered with a different transaction than the transaction being committed. The new transaction is unaware of the change. Later, you might accidentally commit or abort the original transaction. What a mess! If the above guess is correct, you would benefit from the experimental support for binding transactions to connections (like Kapil mentioned.) Your servlets span threads; therefore, transactions should be bound to connections rather than threads. The API is still experimental because connection-bound transactions really ought to be set up at the time you open the database, not when you open the connection. The API is simple enough that we haven't had a strong reason to fix it, though. Shane ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss
