closing resource connections
jamesnichols3 at gmail.com
Tue Dec 23 12:24:05 PST 2008
If you're using JBoss or Weblogic, you must close all database connections
or you're going to run into issues. The way the Jboss pool works, you can
even cause issues on the database server itself (cursor and/or session
issues). You should close database connections, result sets, and prepared
statements. If you enable the track_statements option on your datasource it
will log a message if you're not closing database related stuff properly.
JBoss and weblogic both have this option, though I wouldn't use weblogic's
setting in production.
Web services are a little different since depending on your client library
(Axis, Xfire, etc) and remote endpoint you might get slightly different
behavior (automatic closing). However, in this case, you still should
explicitly close everything or you'll be in trouble and not just in the JVM.
On Tue, Dec 23, 2008 at 3:17 PM, Florian Weimer <fw at deneb.enyo.de> wrote:
> * Victor Cheung:
> > is it recommended that we explicitly close all resource connections?
> > for example, database connections, web service connections, after we
> > use them? (and even if we are using frameworks such as
> > Spring/iBatis)
> I don't know what special support J2EE has in this area. From what
> I've seen, it relies heavily on object pooling, which means that
> closing a resource likely returns it to the pool only (from where it
> can be reused).
> hotspot-gc-use mailing list
> hotspot-gc-use at openjdk.java.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the hotspot-gc-use