• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

connection releasing problem in weblogic.

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using weblogic server to get the connection from the pool
with the helt of data source the code is given below -

Context ctx = new InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup ("jdbc/NMS");
conn = ds.getConnection();

But the problem is i am not able to release the connection.
How I release the connection.
I am continuously taking connection from the data source but not releasing.

Thanx in advance.
Regards -
Vikas Kumar Sahu.
 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you close your connection using conn.close() it will be returned to the pool, but the actual connection will not necessarily be released. However, when you get a new connection from the pool this previous connection might be used again, eliminating the overhead of actually creating a new connection.

You can specify the preferred and maximum number of active connections, as well as the timeout for the connections (i.e. the time it takes before they are actually released by the server if unused) in the pool using the administration console.
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vikas,

Releasing the connection is not our hand. It depends on the container.
But when you do Connection.close(), then connection is aviable to Container to recollect it and give it to another resource if required.
 
If tomatoes are a fruit, then ketchup must be a jam. Taste this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic