| Author |
connection pooling
|
Mariya Antony christopher
Ranch Hand
Joined: Jan 24, 2012
Posts: 49
|
|
I have developed the application using struts 1.1 with connection pooling
In every code ,i close the context ,
try
{
ctx=new InitialContext();
DataSource ds=(DataSource)ds.lookup("java:comp/env/jdbc/myAPP");
}
finally
{
ctx.close();
}
.
.
.
is't possible to close the resultset,connection ,statement properly otherwise it leads to memory leak
it's very urgent suggest your comments
|
 |
William P O'Sullivan
Ranch Hand
Joined: Mar 28, 2012
Posts: 860
|
|
Please explain your problem better.
WP
|
 |
Mariya Antony christopher
Ranch Hand
Joined: Jan 24, 2012
Posts: 49
|
|
William P O'Sullivan wrote:Please explain your problem better.
WP
how to avoid memory leak in connection pool
|
 |
Martin Vajsar
Bartender
Joined: Aug 22, 2010
Posts: 2382
|
|
You'll prevent memory leaks by properly closing all JDBC resources. This is the same regardless of whether you use a connection pool or not.
Some connections (and perhaps connection pools) cache some expensive resources (eg. PreparedStatements), this is certainly the case for Oracle connections. You can alter this behavior by properties or driver specific methods on the connections, and it is usually described in the documentation. This might look like a memory leak, as the memory consumption of the connections in the pool rises as the resources are cached.
|
 |
Mariya Antony christopher
Ranch Hand
Joined: Jan 24, 2012
Posts: 49
|
|
Martin Vajsar wrote:You'll prevent memory leaks by properly closing all JDBC resources. This is the same regardless of whether you use a connection pool or not.
Some connections (and perhaps connection pools) cache some expensive resources (eg. PreparedStatements), this is certainly the case for Oracle connections. You can alter this behavior by properties or driver specific methods on the connections, and it is usually described in the documentation. This might look like a memory leak, as the memory consumption of the connections in the pool rises as the resources are cached.
Thanks for your valuable information
|
 |
 |
|
|
subject: connection pooling
|
|
|