Hi,
In weblogic, when you use connection pool, you look up the connection through DataSource. After using the connection, how do you return the connection to the pool?
Like, you get the connection from pool by calling javax.sql.DataSource.getConnection(), but how to return the connection?
-
Returning Connection in the Pool (3 messages)
- Posted by: Dhiraj Dhake
- Posted on: September 19 2002 07:44 EDT
Threaded Messages (3)
- Returning Connection in the Pool by Ravi Shankar on September 19 2002 09:12 EDT
- Returning Connection in the Pool by Dhiraj Dhake on September 19 2002 09:27 EDT
- Returning Connection in the Pool by Ahmed Talaat on September 19 2002 09:34 EDT
- Returning Connection in the Pool by Dhiraj Dhake on September 19 2002 09:27 EDT
-
Returning Connection in the Pool[ Go to top ]
- Posted by: Ravi Shankar
- Posted on: September 19 2002 09:12 EDT
- in response to Dhiraj Dhake
Call Connection.close(). It does not actually close the connection to the database, but just returns it to the pool. -
Returning Connection in the Pool[ Go to top ]
- Posted by: Dhiraj Dhake
- Posted on: September 19 2002 09:27 EDT
- in response to Ravi Shankar
Hi Ravi,
Thanks for your reply.
Since it is a java.sql.Connection object, calling close() method on the same, actually closes the connection in normal programming.
How is it different in Weblogic Pool? How come it actually does not close? -
Returning Connection in the Pool[ Go to top ]
- Posted by: Ahmed Talaat
- Posted on: September 19 2002 09:34 EDT
- in response to Dhiraj Dhake
because the connection you have is not a real physical connection to the database. The container gives you a handle to the real connection and the close() call ends up inside the container, which is handled by invalidating the connection object handle (from the clients prespective) and marking the pooled conncetion (inside the container) as free for reuse.
This is the whole idea behind pooling, connections are kept open in the pool to avoid the overhead in acquireing them.