Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / September 2005

Tip: Looking for answers? Try searching our database.

Connection Pool Semantics

Thread view: 
stevengarcia@yahoo.com - 27 Sep 2005 22:50 GMT
Should connection pools release all resources associated with a
Connection when a user calls Connection.close()?

Connection.close() just returns the Connection back to the pool.  The
pool that I'm using C3P0 doesn't seem to close any Statement,
PStatement, CStatement, or ResultSets from the Connection.

That doesn't seem right.  Are there pools that actually close all
resources but not the Connection itself?
Joe Weinstein - 27 Sep 2005 23:06 GMT
> Should connection pools release all resources associated with a
> Connection when a user calls Connection.close()?
[quoted text clipped - 5 lines]
> That doesn't seem right.  Are there pools that actually close all
> resources but not the Connection itself?

Yes there are. BEA's WebLogic pools do, for instance. Yes, your
code should work just like standard JDBC. The JDBC spec says
that closing a connection should automatically close any statement
from the connection, and any statement close should automatically
close any result set.
  We actually do some tuneable fancy stuff like transparently
caching PreparedStatements so you can get the benefit of re-use,
but a good pool implementation needs to close subordinate user
objects. Otherwise it can't even guarantee that only one thread
is using a given connection. Eg: a retained statement can be
used to call getConnection()...

Joe Weinstein at BEA
Alfred - 29 Sep 2005 15:19 GMT
> Should connection pools release all resources associated with a
> Connection when a user calls Connection.close()?

It's not important. Every time close ResultSet's and Statement's asap.
Don't rely on unknown implementations, so you will be shure your
resources will be closed.

Good luck


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.