PeterJ wrote : Sorry, I was typing from memory and not from example code. I
meant to also show getting the connection from the datasource and then closing
the connection in the fiinally block.
Thank you Peter. I am happy now that the connection is closing. I am now
deploying to the jboss web
PeterJ wrote : You code should look like:
|
| DataSource ds = null;
| | try {
| | ds = ctx.lookup(...);
| | --do database stuff --
| | } finally {
| | if (ds != null) ds.close();
| | }
|
| If you don't close the datasource before exiting the method, you get
Sorry, I was typing from memory and not from example code. I meant to also
show getting the connection from the datasource and then closing the connection
in the fiinally block.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4003366#4003366
Reply to the post
You code should look like:
DataSource ds = null;
| try {
| ds = ctx.lookup(...);
| --do database stuff --
| } finally {
| if (ds != null) ds.close();
| }
If you don't close the datasource before exiting the method, you get that
warning.
View the original post :