2 Replies Latest reply on Sep 14, 2010 5:18 AM by karthik karthik

    need to get JDBC Connections to 2 different Schemas

    karthik karthik Newbie

      Hi

       

      I need to get JDBC Connections to 2  different Schemas  on 1 DB ( Oracle ) using 2 different  JNDI’s

       

      >>[org.jboss.resource.connectionmanager.CachedConnectionManager]  Closing a connection for you.  Please close them yourself:  org.jboss.resource.adapter.jdbc.WrappedConnection@195dda9

       

      I get this error in spite of  Closing both the Connections finally in my Business Objects ?

       

       

      Note: -  All other Business Objects  use single Connection using 1 JNDI and  have no problems with  them.

       

       

       

      with  regards

        • 1. Re: need to get JDBC Connections to 2 different Schemas
          Zemian Deng Apprentice

          Err... how are you obtaining the Connection object? Through a JBoss DataSource pool? Are you using a PersistenceContext? Hibernate session factory?

           

          Obviously the error indicate that you are using Connection object directly and you didn't close them propertly. You will have to look into your own code to find this problem.

          • 2. Re: need to get JDBC Connections to 2 different Schemas
            karthik karthik Newbie

            Hi

             

            Sorry for the Late Reply ....

             

            >>Through a JBoss DataSource pool?

             

            Yes I am using the JBOSS Datasource pool using JNDI 

             

            I fetch the Connection from wrapper Object

             

            [ Declaration skipped ]

             

            try {
                 connx = ODS.getConnection();
                 WCP = (WrappedConnection)connx;
                 underlyingConn = WCP.getUnderlyingConnection();           
                 connx =  (OracleConnection)underlyingConn;
            } catch (SQLException sqlex) {
                sqlex.printStackTrace();
            }

             

            And close the Connection as

             

            try {
            //Close WRAPPER Connection
            WCP.close();           
            }catch (Exception e) {

             


            Note:-
            I am not using "con.close();"   instead using   "WCP.close();" 
            cause of  Class Cast Exception for EXISTING  ORACLE PLSQL's Call   with in java methods.
            and using the same we see in JMX Connections being released.

             

            with regars
            karthik