Charles Owen wrote:... If you are using any sort of Connection Pooling, setting the Connection object to null returns the connection back to the Connection Pool so it can be reused. ...
It is returned to the pool when you call the close() method.
(although
Sun says
When a Context instance is done with a connection (closed or garbage collected), the connection is returned to the pool for future use.
,
the
Java community typically uses close() to return connections.
I would advise you to do the same. When you call close(), the connection is immediately returned to the pool. That is predictable behavior. Can you predict how/when/if the garbage collector handles it?)
Regards, Jan