1 message in com.mysql.lists.javaProblems creating a temporary table
FromSent OnAttachments
Martin Thomas07 Jan 2003 07:31 
Subject:Problems creating a temporary table
From:Martin Thomas (mart@scarceskills.com)
Date:01/07/2003 07:31:02 AM
List:com.mysql.lists.java

Hi all.

I'm using mysql-max-3.23.49a, and I'm having problems *sometimes* creating
temporary tables.

I'm using the wrox jdbc connection pool classes, which I've slightly modified to ensure they are threadsafe.

In my application I need to create temp tables to simplify some pretty complex
sql. My code currently looks like:

try { connect() to database drop temporary tables if exist create temporary tables type = heap as select ... select xyz from tablea, temp_table where ... } catch (Exception e) { ... } finally { drop temporary tables if exist close() }

Most of the time everything works fine. However, sometimes, I get the error:

SQLException: General error: Table 'temp_table' already exists

I'm pretty sure it can't be anything to do with the connection pooling, as the connection is not given up between the initial drop and the create statements.

HELP! This exception is being thrown 2-3 times a week on a production system
supporting about 150 concurrent users.

Thanks for any advice.