7 Replies Latest reply on Oct 2, 2007 4:40 AM by Nicklas Karlsson

    Stored procedure call causes connection close

    Nicklas Karlsson Master

      Yep, Hibernate specific but some of you might have come across this in a seam context (no pun intended):

      I execute a stored procedure by getting a connection from the (Hibernate) JPA delegate but when the original method exits, my friendly CachedConnectionManager closes the connection. Which isn't very nice in a long running conversation with SMPC.

      Is there a better way to execute stored procedures or is there a way to leave the connection open?

      12:00:34,082 INFO [CachedConnectionManager] Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@170e652
      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)
       at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:47)
       at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
       at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
       at org.hibernate.jdbc.BorrowedConnectionProxy.invoke(BorrowedConnectionProxy.java:50)
       at $Proxy136.prepareCall(Unknown Source)
       at concept.misc.Repository.getNextOrderNumber(Repository.java:370)