Question:
I get messages like the following, what does it mean:
14:58:16,555 WARN [WrappedConnection] Closing a statement you left open, please do
your own housekeeping
Answer:
It means you are not closing your connections to return them to the pool.
To avoid connection leaks you should have code like the following:
| Connection connection = dataSource.getConnection();
| try
| {
| // DO WORK
| }
| finally
| {
| try
| {
| connection.close();
| }
| catch (Throwable ignored)
| {
| }
| }
|
For jdbc you should do the same thing for Statements and ResultSets.
Normally Statements are closed when the Connection is closed, but connection
pooling means the close does not happen.
Similarly, if you have prepared statements in a cache, ResultSets need to be
closed.
Regards,
Adrian
<a
href="http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3825660#3825660">View
the original post</a>
<a
href="http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3825660>Reply
to the post</a>
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user