Hi,

I just realized that invalidation can fail if connection.close is
called afterwards.

e.g.

 String pooldrv="jdbc:apache:commons:dbcp:mypool";
PoolingDriver driver = (PoolingDriver) DriverManager
                .getDriver(pooldrv);

 Connection con=DriverManager.getConnection(pooldrv);
try{
   //something goes wrong with con
 //in my case an sql script creates some temporary tables and
//something might go wrong in the middle of the scipt.
//The validation mechanism can't test if there are temp. tables
//left over, so principally the connection still works, but it's
//ruined for my sql scripts because some temp tables already exist
//Informix doesn't support create or replace temp table
 }
catch
{
driver.getConnectionPool(poolname).invalidateObject(con);
}
con.close();

The particular connection is put pack into the pool and reused,
inspite of the fact that it has been invalidated before.
I realized that I could solve my problem by moving the con.close()
into the try-block, but shouldn't closing invalidated connections
still keep them invalidated?

Regards,

Meikel Bisping





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

Reply via email to