4 Replies Latest reply on Jul 12, 2002 4:50 AM by Camus

    Connection handle is not currently associated with a Managed

    Camus Newbie

      Hi all,

      I am using JBoss 3.0 and successfully use the datasource to get the database connection. However, whenever I use that connection to do any database operations (like prepare statement, set auto commit to true, ...etc), then the following exceptions are displayed. Any help ? Thanks in advance.

      Exception Message:

      2002-07-11 10:46:00,088 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Driver not yet registered for url: jdbc:oracle:thin:@192.168.0.83:1521:bv
      2002-07-11 10:46:00,098 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Driver already registered for url: jdbc:oracle:thin:@192.68.0.81:1521:test
      2002-07-11 10:46:02,883 ERROR [STDERR] java.sql.SQLException: Connection handle is not currently associated with a ManagedConnection
      2002-07-11 10:46:02,885 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.local.LocalConnection.checkStatus(LocalConnection.java:774)
      2002-07-11 10:46:02,885 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.local.LocalConnection.prepareStatement(LocalConnection.java:188)

        • 1. Re: Connection handle is not currently associated with a Man
          Camus Newbie

          Hi I have tried to code the jdbc connection myself instead of through the lookup datasource and it works:
          try {
          DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
          con = DriverManager.getConnection("jdbc:oracle:thin:@bv:1521:bv","test","test");
          } catch(SQLException e) {
          }

          However, this method cannot utilise the connection pooling provided by JBoss.

          Can any JBoss expert helps and explains why ?

          • 2. Re: Connection handle is not currently associated with a Man
            Alan Moor Newbie

            Just on the surface, it looks like you got your IP addresses confused. It says it isn't registered on .83 and that is already used on .81. You reference it in your test as host name "bv". I would check those and see if maybe your ConnectionURL is correct.

            • 3. Re: Connection handle is not currently associated with a Man
              Camus Newbie

              Hi, maybe there is some typos during copy and paste. The connection url is correct. The exception is:

              2002-07-11 10:46:00,088 DEBUG 2002-07-11 10:46:02,883 ERROR [STDERR] java.sql.SQLException: Connection handle is not currently associated with a ManagedConnection
              2002-07-11 10:46:02,885 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.local.LocalConnection.checkStatus(LocalConnection.java:774)
              2002-07-11 10:46:02,885 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.local.LocalConnection.prepareStatement

              BTW, in the oracle server, I can see the connection is binded. Any more help ?!

              • 4. Re: Connection handle is not currently associated with a Man
                Camus Newbie

                Hi, I've go to http://localhost:8082 and have the followings:

                jboss.jca
                service=CachedConnectionManager
                service=LocalTxCM,name=OracleDS
                service=LocalTxDS,name=OracleDS
                service=LocalTxPool,name=OracleDS
                service=RARDeployer
                service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper
                service=RARDeployment,name=JMS Adapter
                service=RARDeployment,name=Minerva JDBC XATransaction ResourceAdapter
                service=XaTxCM,name=jmsra
                service=XaTxDS,name=jmsra

                For the following items, ALL the states are 3 (started)
                service=LocalTxCM,name=OracleDS
                service=LocalTxDS,name=OracleDS
                service=LocalTxPool,name=OracleDS

                However, in service=LocalTxPool,name=OracleDS, the value is:
                Type Not Supported: [org.jboss.resource.connectionmanager.JBossManagedConnectionPool$PoolBySubject@1214b1]

                What else to check or anything wrong ?

                I attached those configuration files (.xml) for reference.