3 Replies Latest reply: May 2, 2012 8:41 AM by 934538 RSS

    XA Datasource with oci driver

    853302

      Hello,

      I've a problem trying to use the oci driver with Oracle 10g XE for an xa datasource.

      My app runs in a Jboss 5.1 server and this is the datasource configuration:

      <xa-datasource>
      <jndi-name>ORACLE_DS</jndi-name>
      <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
      <xa-datasource-property name="URL">jdbc:oracle:oci8:@XE</xa-datasource-property>
      <security-domain>oracle-hibernate</security-domain>
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
      <track-connection-by-tx />
      <isSameRM-override-value>false</isSameRM-override-value>
      <no-tx-separate-pools />
      <min-pool-size>2</min-pool-size>
      <max-pool-size>25</max-pool-size>
      </xa-datasource>

      How you can see I'm using XE as the tns service name, my $TNS_ADMIN is pointing to my linux home dorectory where is the tnsnames.ora file:

      XE =
      (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
      (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
      ))

      For me all looks clean but it doesn't work. This is the error I'm getting from the server:

      20:57:54,017 WARN [TxConnectionManager] Connection error occured: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@155a2e[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@1ad96b4 handles=0 lastUse=1302055072412 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$PoolBySubject@aead4b context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@1f352c5 xaResource=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@1ad96b4 txSync=null]
      oracle.jdbc.xa.OracleXAException
      at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:938)
      at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:244)
      .
      .
      .
      20:57:54,024 ERROR [STDERR] java.lang.IllegalMonitorStateException
      20:57:54,024 ERROR [STDERR] at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(ReentrantLock.java:127)
      .
      .
      .
      20:57:54,129 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
      20:57:54,129 ERROR [JDBCExceptionReporter] Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: a040d3d:96b5:4d9bc88b:6b status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: a040d3d:96b5:4d9bc88b:6b status: ActionStatus.ABORT_ONLY >))
      .
      .
      .
      20:57:54,146 ERROR [STDERR] Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
      20:57:54,146 ERROR [STDERR] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
      .
      .
      .
      20:57:54,147 ERROR [STDERR] Caused by: org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a040d3d:96b5:4d9bc88b:6b status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a040d3d:96b5:4d9bc88b:6b status: ActionStatus.ABORT_ONLY >)
      20:57:54,147 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)
      20:57:54,147 ERROR [STDERR] at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:92)
      20:57:54,147 ERROR [STDERR] at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
      20:57:54,147 ERROR [STDERR] ... 151 more
      20:57:54,147 ERROR [STDERR] Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a040d3d:96b5:4d9bc88b:6b status: ActionStatus.ABORT_ONLY >
      20:57:54,148 ERROR [STDERR] at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:370)
      20:57:54,148 ERROR [STDERR] at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)



      It looks like theres a connection problem but I can't figure out what it is, so any help will be appreciated.

        • 1. Re: XA Datasource with oci driver
          jschellSomeoneStoleMyAlias
          Did you verify that the server box and user under which the JBoss runs can actually connect to Oracle?
          • 2. Re: XA Datasource with oci driver
            853302
            Yes, I've connected successfully to the same TNS service using SQL*Plus with the same user I use for running the server, it is: sqlplus user/password@XE

            I read in the JBoss documentation that for Oracle I should check if the server I'm connecting to has XA and that I could configurate Oracle Database for XA Support but I don't know if my 10g XE installation have this enabled, is there a way to check that?

            It also says "Make sure that Oracle JServer is installed with your database. If it is not installed, you must add it using Oracle Database Configuration Assistant." but I don't remember anything about this during the XE installation, does it has JServer installed by default?

            Thanks in advance
            • 3. Re: XA Datasource with oci driver
              934538
              Any resolution for this? I'm having the same problem.

              Application stack:

              Oracle 11.2.0.1
              jboss 5.1 eap (thin driver)
              ATG 10.0.2

              Jboss trasnactionTimeout incresaed to 72000 sec.

              The error occurs on a bcc full publication.

              error logs:
              oracle.jdbc.xa.OracleXAException
              at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1033)
              at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:240)
              at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.start(XAManagedConnection.java:213)
              at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:799)
              at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:510)
              at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.enlist(TxConnectionManager.java:985)
              at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:739)
              at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:469)
              at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:625)
              at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:499)
              at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
              at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
              at atg.service.jdbc.SwitchingDataSource.getConnection(SwitchingDataSource.java:908)
              at atg.adapter.gsa.GSATransaction.getConnection(GSATransaction.java:742)
              at atg.adapter.gsa.GSAItemDescriptor.getConnection(GSAItemDescriptor.java:2506)
              at atg.adapter.gsa.GSAItemDescriptor.getPersistentItem(GSAItemDescriptor.java:4841)
              at atg.adapter.gsa.GSAItemDescriptor.getOrWaitForPersistentItem(GSAItemDescriptor.java:4684)
              at atg.adapter.gsa.GSAItemDescriptor.getItem(GSAItemDescriptor.java:3048)
              at atg.adapter.gsa.GSARepository.getItem(GSARepository.java:326)
              at atg.deployment.repository.RepositoryWorkerThread.deployItem(RepositoryWorkerThread.java:1033)
              at atg.deployment.repository.RepositoryWorkerThread.processMarkerForAddUpdatePhase(RepositoryWorkerThread.java:234)
              at atg.deployment.DeploymentWorkerThread.processMarkerPhase(DeploymentWorkerThread.java:534)
              at atg.deployment.DeploymentWorkerThread.run(DeploymentWorkerThread.java:307)
              2012-05-02 21:19:40,998 ERROR [STDERR] (RepositoryWorkerThread-6(Add-Update Phase)) java.lang.IllegalMonitorStateException
              2012-05-02 21:19:40,998 ERROR [STDERR] (RepositoryWorkerThread-6(Add-Update Phase)) at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(ReentrantLock.java:127)
              2012-05-02 21:19:40,998 ERROR [STDERR] (RepositoryWorkerThread-6(Add-Update Phase)) at java.util.concurrent.locks.AbstractQueuedSynchronizer.release(AbstractQueuedSynchronizer.java:1239)
              2012-05-02 21:19:40,998 ERROR [STDERR] (RepositoryWorkerThread-6(Add-Update Phase)) at java.util.concurrent.locks.ReentrantLock.unlock(ReentrantLock.java:431)
              2012-05-02 21:19:40,998 ERROR [STDERR] (RepositoryWorkerThread-6(Add-Update Phase)) at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.unlock(BaseWrapperManagedConnection.java:278)
              2012-05-02 21:19:40,998 ERROR [STDERR] (RepositoryWorkerThread-6(Add-Update Phase)) at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.start(XAManagedConnection.java:235)
              2012-05-02 21:19:40,998 ERROR [STDERR] (RepositoryWorkerThread-6(Add-Update Phase)) at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:799)
              2012-05-02 21:19:40,998 ERROR [STDERR] (RepositoryWorkerThread-6(Add-Update Phase)) at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:510)
              2012-05-02 21:19:40,998 ERROR [STDERR] (RepositoryWorkerThread-6(Add-Update Phase)) at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.enlist(TxConnectionManager.java:985)
              2012-05-02 21:19:40,998 ERROR [STDERR] (RepositoryWorkerThread-6(Add-Update Phase)) at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:739)

              Edited by: 931535 on May 2, 2012 6:33 AM