aspose file tools*
The moose likes JDBC and the fly likes connection releasing problem in weblogic. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "connection releasing problem in weblogic." Watch "connection releasing problem in weblogic." New topic
Author

connection releasing problem in weblogic.

Vikas Sahu
Greenhorn

Joined: Mar 07, 2003
Posts: 29
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.


Regards -<br />Vikas Kumar Sahu
Mattias Arthursson
Ranch Hand

Joined: Jul 26, 2004
Posts: 90
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.


Admit nothing. Blame everyone. Be bitter.
Vikalp Singh
Ranch Hand

Joined: Dec 29, 2002
Posts: 50
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: connection releasing problem in weblogic.