7 Replies Latest reply on Jul 19, 2002 5:55 PM by Brent Roberts

    reclaiming managed connections

    Jason Taft Newbie

      I have set up an XA Datasource using the Oracle XA driver.

      I am able to get connections fine, but when I call close() on the connection, the connection is not put back into the pool.

      Is there another call that I should be making? I even tried calling commit() after the close, but it had no effect.

      Thanks for the help.

        • 1. Re: reclaiming managed connections
          Brent Roberts Newbie

          Thanks Jason,
          I installed the JAVA_XA package on my oracle.Now I can connect to oracle using XA datasource.
          Anil

          • 2. Re: reclaiming managed connections
            Anil Bholankar Newbie

            Hi,
            I am also using Oracle XA driver to setup an XA Datasource.But I get an SQLEXception "Connection refused" while I deploy my jar file.Can u help in configuring my XA datasource?.Some problem with login-config.xml??
            Thanks.
            Anil

            • 3. Re: reclaiming managed connections
              Jason Taft Newbie

              I am not using the login module, yet. Trying to get everything working before securing it. Short of seeing the exact exception and your configuration, I would recommend trying to connection and use the datasource before worrying about security.

              • 4. Re: reclaiming managed connections
                Anil Bholankar Newbie

                Hi,
                I am able to connect to oracle now with XADatasource,
                but now I get the following error...
                09:47:58,436 ERROR [STDERR] java.sql.SQLException: ORA-29540: class oracle/jdbc/
                xa/server/OracleWrapXAResource does not exist
                ORA-06512: at "SYSTEM.JAVA_XA", line 0
                ORA-06512: at line 1
                I am using oracle 8.1.7 Enterprise edition.Have u come across any such errors?
                Below is my Config...




                <!-- ==================================================================== -->
                <!-- ConnectionManager setup for xa oracle dbs -->
                <!-- Thanks to igor fedorenko <ifedorenko@thinkdynamics.com> -->
                <!-- Build jmx-api (build/build.sh all) and view for config documentation -->
                <!-- YOU MUST CHANGE THE XidFactoryMBean config to this:


                true

                -->
                <!-- ==================================================================== -->


                <!--make the rar deploy! hack till better deployment-->
                jboss.jca:service=RARDeployer


                <depends optional-attribute-name="ManagedConnectionFactoryName">
                <!--embedded mbean-->

                <!--hack-->
                <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=Minerva JDBC XATransaction ResourceAdapter

                <!--real attributes-->


                <config-property name="XADataSourceProperties"
                type="java.lang.String">URL=jdbc:oracle:thin:@ipaddress:1521:DB</config-property>
                <config-property name="XADataSourceClass"
                type="java.lang.String">oracle.jdbc.xa.client.OracleXADataSource</config-property>
                <!--set these only if you want only default logins, not through JAAS -->
                <config-property name="UserName"
                type="java.lang.String">xx</config-property>
                <config-property name="Password"
                type="java.lang.String">xx</config-property>
                <!--
                Do not try to set transaction isolation level here or you'll get
                java.sql.SQLException: ORA-01453: SET TRANSACTION must be first statement of transaction
                Read committed is a default isolation level for Oracle, so there
                is not real need to set it here. I'll take a look into it later ...maybe.
                <config-property name="TransactionIsolation"
                type="java.lang.String">TRANSACTION_READ_COMMITTED</config-property>
                -->


                XAOracleDS



                <depends optional-attribute-name="ManagedConnectionPool">
                <!--embedded mbean-->


                1
                50
                5000
                15
                <!--criteria indicates if Subject (from security domain) or app supplied
                parameters (such as from getConnection(user, pw)) are used to distinguish
                connections in the pool. Choices are
                ByContainerAndApplication (use both),
                ByContainer (use Subject),
                ByApplication (use app supplied params only),
                ByNothing (all connections are equivalent, usually if adapter supports
                reauthentication)-->
                ByContainer


                <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager

                <!-- Include a login module configuration named InformixXaDbRealm.
                Update your login-conf.xml, here is an example for a
                ConfiguredIdentityLoginModule:

                <application-policy name = "InformixXaDbRealm">

                <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
                <module-option name = "principal">yourprincipal</module-option>
                <module-option name = "userName">yourusername</module-option>
                <module-option name = "password">yourpassword</module-option>
                <module-option name = "managedConnectionFactoryName">jboss.jca:service=XATxCM,name=InformixXaDS</module-option>
                </login-module>

                </application-policy>

                NOTE: the application-policy name attribute must match SecurityDomainJndiName, and the
                module-option name = "managedConnectionFactoryName"
                must match the object name of the ConnectionManager you are configuring here.
                -->
                <!--uncomment out this line if you are using the InformixXaDbRealm above
                InformixXaDbRealm
                -->

                <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:service=JaasSecurityManager

                java:/TransactionManager




                Thanks
                Anil

                • 5. Re: reclaiming managed connections
                  Jason Taft Newbie

                  I found the following on the metalink Oracle site. It sounds like you have an Oracle configuration issue...



                  Problem Description
                  -------------------

                  Testing Environment:

                  Product: THIN (8.1.7)
                  Rdbms: 8.1.7
                  Platform: HP 9000 Series HP-UX (2) (B.10.20)
                  JDK Version: JDK 1.3.1
                  CLASSPATH variable: classes12.zip:jta.zip:jdbc.zip
                  Weblogic 6.1

                  You are trying to use the Type 4 XA Drivers to access Oracle.

                  When you deploy the Bean which uses the Type 4 XA Driver, you get a stack dump:

                  java.sql.SQLException: ORA-29540: class oracle/jdbc/xa/server/OracleWrapXAResource does not exist
                  ORA-06512: at "SYS.JAVA_XA", line 0
                  ORA-06512: at line 1
                  at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
                  at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
                  at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:542)
                  at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1311)
                  at
                  oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:738)
                  at
                  oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1313)
                  at
                  oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1232)
                  at
                  oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(OracleStatement.java:1353)
                  at
                  oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java:1760)
                  at
                  oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1805)
                  at
                  oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:320)
                  at
                  oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:364)
                  at
                  oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:102)


                  You have run initjvm.sql successfully.

                  You may notice the class file "OracleWrapXAResource" in aurora.zip on
                  the oracle side. But if you put it in the client CLASSPATH, it
                  still can't find it.



                  Solution Description
                  --------------------

                  The class:

                  oracle/jdbc/xa/server/OracleWrapXAResource

                  Is part of the server and therefore changing the CLASSPATH will have
                  no effect.

                  This error is caused because you ran the script initjvm as
                  SYSTEM instead of SYS. To solve this you need to
                  drop the DBMS_JAVA package that was created in the SYSTEM
                  schema by initjvm.sql, then run initjvm.sql as SYS.

                  • 6. Re: reclaiming managed connections
                    Anil Bholankar Newbie

                    Thanks Jason,
                    I installed the JAVA_XA package on my oracle.Now I can connect to oracle using XA datasource.
                    Anil

                    • 7. Re: reclaiming managed connections
                      Brent Roberts Newbie

                      Just upgraded to JBoss 2.4.8 from 2.4.4. Under 2.4.4, we knew we had problems with connection pooling but did not receive the nice error, "No Managed Connections Available", that 2.4.8 gives.

                      We are using Oracle 9i with our jboss.jcml as follows:


                      oracle.jdbc.driver.OracleDriver



                      CisDS
                      org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl

                      jdbc:oracle:thin:@localhost:1521:NISC1
                      1200000
                      cisnew
                      30
                      cis
                      false
                      false
                      false
                      true
                      15000
                      120000
                      1800000
                      false
                      false
                      1.0
                      0



                      Does anyone have a solution?

                      Thanks,
                      Brent