Hi dbforms developers,
a friend of mine told me that he had problems with connection
management by dbforms.
I recently had some problems using the commons connection pool in my
own application, so the following observation might be interesting
for you.
(I sent it to the commons dev mailing list, but got no reply yet).
------
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
-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start! http://www.idcswdc.com/cgi-bin/survey?id5hix
_______________________________________________
DbForms Mailing List
http://www.wap-force.net/dbforms