In one of my management bean methods I:
- Create a connection using the injected data source
- Pass that connection to a legacy code that keeps the connection for further usage
- Get out of the method without closing the connection
I wanted the connection to stay alive, however I am getting the following:
INFO [org.jboss.resource.connectionmanager.CachedConnectionManager] Closing a connection
for you. Please close them yourself:
org.jboss.resource.adapter.jdbc.WrappedConnection@434ff9
java.lang.Throwable: STACKTRACE
at
org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:290)
at
org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:417)
at
org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
at
org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
... (user code)
Questions:
- I know that I should be closing the connections, but since it's just a legacy code
wrapper, is there a way not to do that? I cannot set a connection on the legacy code
again, it is supported only during the object creation, which is time-wise very costly
- If the above approach is not a good one, is there an alternative approach that would
satisfy the given criteria. I'm on JBoss 4.2.1.GA.
If you need more info, please let me know.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4189916#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...