The moose likes Websphere and the fly likes do we need to close context in websphere Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Websphere
Reply Bookmark "do we need to close context in websphere" Watch "do we need to close context in websphere" New topic
Author

do we need to close context in websphere

info babu
Ranch Hand

Joined: Nov 08, 2001
Posts: 30
Hello
Any body can tell me i am doing a connection pooling programe in websphere 3.0.2 and back end is DB2 as400

when i was writting a program i forgot close the connection context.close in my programe
do i need to close alway this context.
Because my connection pooling programe is faiiling , i could not able to find the reason. i think it may one reason.
can any body tell me do i need to close it(context.close())
I would appricate any bodys help
Thank YOu
Babu
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3878
If you mean close each Connection the answer is YES. Closing a connection returns it to the connection pool in the datasource. Otherwise, it will remain "used" until the reaper thread recovers it (the default timeout here is 30 minutes -- see the Websphere admin documentation on DataSource setup).
If you mean InitialContexts or Datasources, no you do not close them.
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
 
 
subject: do we need to close context in websphere
 
Threads others viewed
Pooled Connections - EJB Shutdown
DB2
jdbc-servlets-connection pooling
Notification when user closes browser or leaves session
Difference between close & null with regards to connection

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture