2 Replies Latest reply on Sep 8, 2004 3:26 AM by Adrian Brock

    ConnectionManager can´t close connection

    Fernando Rodrigues Newbie


      Hi.

      I´m using Jboss 3.2.3 with DB2.
      I wanted to define a datasource with JNDI without autocommit, so the best i could do until now was define the file corecomp-ds.xml:

      <?xml version="1.0" encoding="UTF-8"?>


      <no-tx-datasource>
      <jndi-name>CoreCompDS1</jndi-name>
      <connection-url>jdbc:db2://sporting:50000/CC</connection-url>
      <driver-class>com.ibm.db2.jcc.DB2Driver</driver-class>
      <user-name>USER</user-name>
      PWD


      <min-pool-size>3</min-pool-size>
      <max-pool-size>10</max-pool-size>
      <blocking-timeout-millis>5000</blocking-timeout-millis>
      <idle-timeout-minutes>1</idle-timeout-minutes>


      </no-tx-datasource>


      And in my application, each time i make a datasource.getConnection() i set the autocommit off in the connection i get. Ok.. seems to work... but something is going wrong because when i use my application, in the next 5 minutes i receive a warning:

      17:45:39,351 WARN [JBossManagedConnectionPool] Exception destroying ManagedConnection
      org.jboss.resource.JBossResourceException: SQLException; - nested throwable: (com.ibm.db2.jcc.b.SQLException:
      java.sql.Connection.close() requested while a transaction is in progress on the connection.The transaction remains
      active, and the connection cannot be closed.)
      at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.checkException(BaseWrapperManagedConnection.java
      :546)
      at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.destroy(BaseWrapperManagedConnection.java:252)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.doDestroy(InternalManagedConnectionPool.ja
      va:502)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.removeTimedOut(InternalManagedConnectionPo
      ol.java:365)
      at org.jboss.resource.connectionmanager.IdleRemover$1.run(IdleRemover.java:70)
      at java.lang.Thread.run(Thread.java:534)
      Caused by: com.ibm.db2.jcc.b.SQLException: java.sql.Connection.close() requested while a transaction is in progress on t
      he connection.The transaction remains active, and the connection cannot be closed.
      at com.ibm.db2.jcc.b.l.j(l.java:556)
      at com.ibm.db2.jcc.b.l.close(l.java:540)
      at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.destroy(BaseWrapperManagedConnection.java:248)
      ... 4 more

      I make all the commit and rollback needed and i can´t figure out what´s going on. When i invoke the datasource.getConnection() and
      i just do a select, i just have to make a final connection.close() and nothing more right?

      Tks in advance