Michael McTernan wrote:

My problem, that so far no one has been able to answer, is that I'm using
connection pooling with the Tomcat server.

TransactionA gets connection A from the pool.
TransactionA creates a temporary table for some query.
TransactionA is done, and returns the connection to the pool.
TransactionB gets a connection from the pool, which just so happens to be
connection A.
TransactionB tries to create a temporary table with the same name as the one
that already exists.
** BANG!! **

Yes, you're right -- as long as the container-managed connection is open, the original TEMPORARY table will persist across the sessions of different individuals.

I just ran into this issue myself, and so far I've thought of

1) creating a *unique* temporary table using the SESSIONID, in a
   separate DB where the tomcat 'user' has DROP privileges, and use
   a method implementing HttpSessionBindingListener to drop that
   table when the session terminates;

2) just keeping the original ResultSet in memory and manipulating
   it there...

Neither quite as graceful as using a real temporary table, so I'm
also open to other suggestions :-)

--
Hassan Schroeder ----------------------------- [EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

dream. code.




-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to