users@glassfish.java.net

how to release connections back to the connection pool

From: <glassfish_at_javadesktop.org>
Date: Fri, 15 Feb 2008 08:53:23 PST

I am using connection pooling and am running into the following difficulty. The web-app runs fine until it runs out of available connections and i then get this error:

[b]java.sql.SQLException: Error in allocating a connection. Cause: In-use connections equal max-pool-size and expired max-wait-time. Cannot allocate more connections.
        at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:115)[/b]

Obviously i am not releasing the connections back to the pool when i am done using them. I thought i was by calling:

myCon.closeCon();

where myCon is the connection. How come this doesn't release the connection back to the pool? Is there are better way, or perhaps a way to force all connections to be released once the web-app is done?

many thanks
[Message sent by forum member 'hughacland' (hughacland)]

http://forums.java.net/jive/thread.jspa?messageID=259217