10 Replies Latest reply: Feb 23, 2011 10:40 AM by Jonathan Halliday RSS

OracleXAException JBoss 5.0.0.Beta4 accessing two data sourc

Jay Perkins Newbie

I have two data sources (both pointing to the same database) that both do some work in the same transaction. Access to the first datasource goes smoothly, but when trying to enlist the second one I get an OracleXAException - a snippet of the error and stack trace are below. I have set all of the properties that I could find on the web about OracleXAExceptions, notably:
<track-connection-by-tx/>
<isSameRM-override-value>false</isSameRM-override-value>
<no-tx-separate-pools/>

The complete data-sources-ds.xml is below. I know I am using a Beta version but I couldn't find anything referring to this type of problem for 5.0.0.Beta4.

I did check the JMX MBean view and all of the properties seem to be correct. One item of interest, not sure if it means anything, but with full logging on, I see different InUse/Available/Max output for the different datasources.

The first datasource output looks like this:
[InUse/Available/Max]: [1/9/10]
Which is good because I set a min connections of 1 and a max connections of 10.

However the second datasource output looks like this:
[InUse/Available/Max]: [1/19/20]
Which is odd because I set the same min/max settings as the first data source.

Anybody have an idea about what I am doing wrong? Please let me know if I can provide any more information.


2008-08-28 22:37:08,051 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] isManagedConnectionFree=true mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@ca8735
2008-08-28 22:37:08,051 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] delisting org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@1103411[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@ca8735 handles=0 lastUse=1219977403535 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$PoolBySubject@60abc5 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@ad2738 xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@72dc45 txSync=null]
2008-08-28 22:37:08,051 TRACE [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] putting ManagedConnection back into pool kill=false cl=org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@1103411[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@ca8735 handles=0 lastUse=1219977403535 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$PoolBySubject@60abc5 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@ad2738 xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@72dc45 txSync=null]
2008-08-28 22:37:08,051 TRACE [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Returning connection to pool org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@1103411[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@ca8735 handles=0 lastUse=1219977428051 permit=false trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$PoolBySubject@60abc5 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@ad2738 xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@72dc45 txSync=null] [InUse/Available/Max]: [0/20/20]
2008-08-28 22:37:09,035 WARN [com.arjuna.ats.jta.logging.loggerI18N] [com.arjuna.ats.internal.jta.transaction.arjunacore.xastart] [com.arjuna.ats.internal.jta.transaction.arjunacore.xastart] TransactionImple.enlistResource - xa_start - caught: XAException.XA_RETRY for < 131075, 27, 25, 1--53effea2:4b4:48b76019:6e-53effea2:4b4:48b76019:72 >
2008-08-28 22:37:09,035 ERROR [STDERR] oracle.jdbc.xa.OracleXAException
2008-08-28 22:37:09,035 ERROR [STDERR] at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:882)
2008-08-28 22:37:09,035 ERROR [STDERR] at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:221)
2008-08-28 22:37:09,035 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.start(XAManagedConnection.java:188)
2008-08-28 22:37:09,035 ERROR [STDERR] at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:865)
2008-08-28 22:37:09,035 ERROR [STDERR] at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:499)
2008-08-28 22:37:09,035 ERROR [STDERR] at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.enlist(TxConnectionManager.java:827)
2008-08-28 22:37:09,035 ERROR [STDERR] at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:618)
2008-08-28 22:37:09,035 ERROR [STDERR] at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:375)
2008-08-28 22:37:09,035 ERROR [STDERR] at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:516)
2008-08-28 22:37:09,035 ERROR [STDERR] at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:397)
2008-08-28 22:37:09,035 ERROR [STDERR] at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:838)
2008-08-28 22:37:09,035 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
2008-08-28 22:37:09,035 ERROR [STDERR] at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:47)
2008-08-28 22:37:09,035 ERROR [STDERR] at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)

Below is the data-sources-ds.xml:
<xa-datasource>
<jndi-name>TestResultStorePU-ds</jndi-name>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
<min-pool-size>1</min-pool-size>
<max-pool-size>10</max-pool-size>

<xa-datasource-property name="User">aaaa</xa-datasource-property>
<xa-datasource-property name="Password">aaaa</xa-datasource-property>
<xa-datasource-property name="URL">jdbc:oracle:thin:@aaaaa:1521:aaaa</xa-datasource-property>
<track-connection-by-tx/>
<isSameRM-override-value>false</isSameRM-override-value>
<no-tx-separate-pools/>
</xa-datasource>


java:/TestResultStorePU-ds
TestResultStorePU-ds


<xa-datasource>
<jndi-name>StepStorePU-ds</jndi-name>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
<min-pool-size>1</min-pool-size>
<max-pool-size>10</max-pool-size>

<xa-datasource-property name="User">aaaa</xa-datasource-property>
<xa-datasource-property name="Password">aaaa</xa-datasource-property>
<xa-datasource-property name="URL">jdbc:oracle:thin:@aaaa:1521:aaaa</xa-datasource-property>
<track-connection-by-tx/>
<isSameRM-override-value>false</isSameRM-override-value>
<no-tx-separate-pools/>
</xa-datasource>


java:/StepStorePU-ds
StepStorePU-ds

  • 1. Re: OracleXAException JBoss 5.0.0.Beta4 accessing two data s
    jade king Newbie

    I have the same problem with you,did you have fixed it?

  • 2. Re: OracleXAException JBoss 5.0.0.Beta4 accessing two data sourc
    Andrii Kovalov Newbie

    I have the same issue, did you found any solution?

  • 3. OracleXAException JBoss 5.0.0.Beta4 accessing two data sourc
    ducheol kim Newbie

    I have the same problem on jboss-5.1.0. did you found any soultion?

  • 4. OracleXAException JBoss 5.0.0.Beta4 accessing two data sourc
    Wolf-Dieter Fink Master

    I'm not sure but I suppose it is related to the transaction handling on JBoss and/or Oracle side.

    Do you use exact the same user and instance for both DS?

  • 5. OracleXAException JBoss 5.0.0.Beta4 accessing two data sourc
    ducheol kim Newbie

    Yes , we use same user.

    We make 3 data source, and in this case we use same data source twice.

    ( Because we support mysql/oracle on one code. )

     

    Do you have any referal article or any solution?

     

    Thanks

    Ducheol

  • 6. OracleXAException JBoss 5.0.0.Beta4 accessing two data sourc
    Wolf-Dieter Fink Master

    My suspicion is that oracle is in trouble if different transactions are working at the same time from different DS.

    e.g. generation of TxId

    What about if you create a second user with permissions to the same tables?

  • 7. OracleXAException JBoss 5.0.0.Beta4 accessing two data sourc
    ducheol kim Newbie

    In my case, we use difference table.And that issue is happend during read other table with new connection.

  • 8. OracleXAException JBoss 5.0.0.Beta4 accessing two data sourc
    Wolf-Dieter Fink Master

    AFAIK the entity manager will open a transaction nevertheless it is a read or write.

    But BTW if you access different tables why you did not use different schema? We have such in our environment and it works.

    Agree that I always want to know the reason for this behaviour!

  • 9. OracleXAException JBoss 5.0.0.Beta4 accessing two data sourc
    ducheol kim Newbie

    Hi I attached actual stack trace message on end of my message.

     

    We use hibernate for ORM framework.

     

    It happened during one transaction is processing.

     

    We try to open another connection to retreive other information during other transaction.

     

    And error is happend on that time.

     

     

    Below is our db pooling configuration.

     

    <datasources>

            <xa-datasource>

                    <jndi-name>jdbc/XXXXX</jndi-name>

                    <track-connection-by-tx>true</track-connection-by-tx>

                    <isSameRM-override-value>false</isSameRM-override-value>

                    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>

                    <xa-datasource-property name="URL">jdbc:oracle:thin:@YYYYY:1521:ZZZZ</xa-datasource-property>

                    <xa-datasource-property name="User">AAAA</xa-datasource-property>

                    <xa-datasource-property name="Password">BBBB</xa-datasource-property>

                    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>

                    <new-connection-sql>alter session set nls_date_format='YYYY-MM-DD HH24:MI:SS' nls_comp='LINGUISTIC' nls_sort='BINARY_CI'</new-connection-sql>

                    <min-pool-size>5</min-pool-size>

                    <max-pool-size>150</max-pool-size>

                    <no-tx-separate-pools/>

            </xa-datasource>

    </datasources>

     

     

     

     

    StackTrace message :

    12:32:04,770 WARN  [TxConnectionManager] Connection error occured: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@22f97b70[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@73813e84 handles=0 lastUse=1298289695581 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@2ef662c1 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@31cd84fd xaResource=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@73813e84 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)

            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:908)

            at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:662)

            at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:403)

            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 org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:59)

            at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:298)

            at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:110)

            at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:88)

            at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1162)

            at org.hibernate.loader.Loader.doQuery(Loader.java:390)

            at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)

            at org.hibernate.loader.Loader.doList(Loader.java:1593)

            at org.hibernate.loader.Loader.list(Loader.java:1577)

            at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395)

            at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)

            at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)

            at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)

            at com.XXXX.BaseDAO.findObjects(BaseDAO.java:167)

    ......

    ......

    ...... 

            at sun.reflect.GeneratedMethodAccessor347.invoke(Unknown Source)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:597)

            at org.jboss.invocation.Invocation.performCall(Invocation.java:386)

            at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:228)

            at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:156)

            at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)

            at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)

            at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:173)

            at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:77)

            at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:173)

            at org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:228)

            at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:211)

            at org.jboss.ejb.plugins.security.PreSecurityInterceptor.process(PreSecurityInterceptor.java:97)

            at org.jboss.ejb.plugins.security.PreSecurityInterceptor.invoke(PreSecurityInterceptor.java:81)

            at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)

            at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)

            at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:650)

            at org.jboss.ejb.Container.invoke(Container.java:1029)

            at sun.reflect.GeneratedMethodAccessor257.invoke(Unknown Source)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:597)

            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)

            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)

            at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)

            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)

            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)

            at org.jboss.invocation.unified.server.UnifiedInvoker.invoke(UnifiedInvoker.java:232)

            at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)

            at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)

            at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)

            at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:551)

            at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)

    12:32:04,772 ERROR [STDERR] java.lang.IllegalMonitorStateException

    12:32:04,773 ERROR [STDERR]     at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(ReentrantLock.java:127)

    12:32:04,773 ERROR [STDERR]     at java.util.concurrent.locks.AbstractQueuedSynchronizer.release(AbstractQueuedSynchronizer.java:1239)

    12:32:04,773 ERROR [STDERR]     at java.util.concurrent.locks.ReentrantLock.unlock(ReentrantLock.java:431)

    12:32:04,773 ERROR [STDERR]     at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.unlock(BaseWrapperManagedConnection.java:277)

    12:32:04,773 ERROR [STDERR]     at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.start(XAManagedConnection.java:235)

    12:32:04,773 ERROR [STDERR]     at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:799)

    12:32:04,773 ERROR [STDERR]     at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:510)

    12:32:04,773 ERROR [STDERR]     at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.enlist(TxConnectionManager.java:908)

    12:32:04,773 ERROR [STDERR]     at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:662)

    12:32:04,773 ERROR [STDERR]     at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:403)

    12:32:04,773 ERROR [STDERR]     at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:625)

    12:32:04,773 ERROR [STDERR]     at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:499)

    12:32:04,773 ERROR [STDERR]     at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)

    12:32:04,773 ERROR [STDERR]     at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)

    12:32:04,773 ERROR [STDERR]     at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:59)

    12:32:04,773 ERROR [STDERR]     at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:298)

    12:32:04,773 ERROR [STDERR]     at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:110)

    12:32:04,774 ERROR [STDERR]     at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:88)

    12:32:04,774 ERROR [STDERR]     at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1162)

    12:32:04,774 ERROR [STDERR]     at org.hibernate.loader.Loader.doQuery(Loader.java:390)

    12:32:04,774 ERROR [STDERR]     at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)

    12:32:04,774 ERROR [STDERR]     at org.hibernate.loader.Loader.doList(Loader.java:1593)

    12:32:04,774 ERROR [STDERR]     at org.hibernate.loader.Loader.list(Loader.java:1577)

    12:32:04,774 ERROR [STDERR]     at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395)

    12:32:04,774 ERROR [STDERR]     at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)

    12:32:04,774 ERROR [STDERR]     at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)

    12:32:04,774 ERROR [STDERR]     at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)

    12:32:04,774 ERROR [STDERR]     at com.XXXX.BaseDAO.findObjects(BaseDAO.java:167)

    ......

    ......

    ......

    ......

    12:32:04,774 ERROR [STDERR]     at sun.reflect.GeneratedMethodAccessor347.invoke(Unknown Source)

    12:32:04,774 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    12:32:04,774 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:597)

    12:32:04,774 ERROR [STDERR]     at org.jboss.invocation.Invocation.performCall(Invocation.java:386)

    12:32:04,774 ERROR [STDERR]     at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:228)

    12:32:04,774 ERROR [STDERR]     at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:156)

    12:32:04,774 ERROR [STDERR]     at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)

    12:32:04,775 ERROR [STDERR]     at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)

    12:32:04,775 ERROR [STDERR]     at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:173)

    12:32:04,775 ERROR [STDERR]     at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:77)

    12:32:04,775 ERROR [STDERR]     at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:173)

    12:32:04,775 ERROR [STDERR]     at org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:228)

    12:32:04,775 ERROR [STDERR]     at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:211)

    12:32:04,775 ERROR [STDERR]     at org.jboss.ejb.plugins.security.PreSecurityInterceptor.process(PreSecurityInterceptor.java:97)

    12:32:04,775 ERROR [STDERR]     at org.jboss.ejb.plugins.security.PreSecurityInterceptor.invoke(PreSecurityInterceptor.java:81)

    12:32:04,775 ERROR [STDERR]     at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)

    12:32:04,775 ERROR [STDERR]     at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)

    12:32:04,775 ERROR [STDERR]     at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:650)

    12:32:04,775 ERROR [STDERR]     at org.jboss.ejb.Container.invoke(Container.java:1029)

    12:32:04,775 ERROR [STDERR]     at sun.reflect.GeneratedMethodAccessor257.invoke(Unknown Source)

    12:32:04,775 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    12:32:04,775 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:597)

    12:32:04,775 ERROR [STDERR]     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)

    12:32:04,775 ERROR [STDERR]     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)

    12:32:04,775 ERROR [STDERR]     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)

    12:32:04,775 ERROR [STDERR]     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)

    12:32:04,775 ERROR [STDERR]     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)

    12:32:04,775 ERROR [STDERR]     at org.jboss.invocation.unified.server.UnifiedInvoker.invoke(UnifiedInvoker.java:232)

    12:32:04,775 ERROR [STDERR]     at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)

    12:32:04,775 ERROR [STDERR]     at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)

    12:32:04,776 ERROR [STDERR]     at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)

    12:32:04,776 ERROR [STDERR]     at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:551)

    12:32:04,776 ERROR [STDERR]     at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)

    12:32:04,786 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null

    12:32:04,786 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: a49841c:d772:4d5f0198:41d6 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: a49841c:d772:4d5f0198:41d6 status: ActionStatus.ABORT_ONLY >))

    12:32:04,789 ERROR [STDERR] org.hibernate.exception.GenericJDBCException: Cannot open connection

            at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)

            at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)

            at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)

            at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)

            at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:301)

            at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:110)

            at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:88)

            at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1162)

            at org.hibernate.loader.Loader.doQuery(Loader.java:390)

            at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)

            at org.hibernate.loader.Loader.doList(Loader.java:1593)

            at org.hibernate.loader.Loader.list(Loader.java:1577)

            at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395)

            at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)

            at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)

            at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)

            at com.XXXX.BaseDAO.findObjects(BaseDAO.java:167)

    ......

    ......

    ......

    ......

            at sun.reflect.GeneratedMethodAccessor347.invoke(Unknown Source)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:597)

            at org.jboss.invocation.Invocation.performCall(Invocation.java:386)

            at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:228)

            at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:156)

            at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)

            at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)

            at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:173)

            at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:77)

            at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:173)

            at org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:228)

            at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:211)

            at org.jboss.ejb.plugins.security.PreSecurityInterceptor.process(PreSecurityInterceptor.java:97)

            at org.jboss.ejb.plugins.security.PreSecurityInterceptor.invoke(PreSecurityInterceptor.java:81)

            at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)        at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)        at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:650)        at org.jboss.ejb.Container.invoke(Container.java:1029)        at sun.reflect.GeneratedMethodAccessor257.invoke(Unknown Source)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:597)

            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)

            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)

            at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)

            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)

            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)

            at org.jboss.invocation.unified.server.UnifiedInvoker.invoke(UnifiedInvoker.java:232)

            at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)

            at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)

            at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)

            at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:551)

            at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)

    Caused by: org.jboss.util.NestedSQLException: 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: a49841c:d772:4d5f0198:41d6 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: a49841c:d772:4d5f0198:41d6 status: ActionStatus.ABORT_ONLY >))

            at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)

            at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:59)

            at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:298)

            ... 50 more

    Caused by: 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: a49841c:d772:4d5f0198:41d6 status: ActionStatus.ABORT_ONLY >)

            at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:409)

            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)

            ... 52 more

    Caused by: javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: a49841c:d772:4d5f0198:41d6 status: ActionStatus.ABORT_ONLY >

            at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.checkEnlisted(TxConnectionManager.java:879)

            at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:675)

            at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:403)

            ... 56 more

    12:32:04,790 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null

    12:32:04,790 ERROR [JDBCExceptionReporter] Transaction TransactionImple < ac, BasicAction: a49841c:d772:4d5f0198:41d6 status: ActionStatus.ABORT_ONLY > cannot proceed STATUS_MARKED_ROLLBACK; - nested throwable: (javax.transaction.RollbackException: Transaction TransactionImple < ac, BasicAction: a49841c:d772:4d5f0198:41d6 status: ActionStatus.ABORT_ONLY > cannot proceed STATUS_MARKED_ROLLBACK)      12:32:04,790 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null12:32:04,790 ERROR [JDBCExceptionReporter] Transaction TransactionImple < ac, BasicAction: a49841c:d772:4d5f0198:41d6 status: ActionStatus.ABORT_ONLY > cannot proceed STATUS_MARKED_ROLLBACK; - nested throwable: (javax.transaction.RollbackException: Transaction TransactionImple < ac, BasicAction: a49841c:d772:4d5f0198:41d6 status: ActionStatus.ABORT_ONLY > cannot proceed STATUS_MARKED_ROLLBACK)       

  • 10. OracleXAException JBoss 5.0.0.Beta4 accessing two data sourc
    Jonathan Halliday Master

    There are actually two distinct issues on this thread.

     

    Using 2 (or more) XA datasources with the oracle JDBC driver blows up because of the strange way they defined some object equivalence in the driver. It's been a while but IIRC you can kludge around the issue by using connection URLs that are semantically equivalent whilst having different String values.  The easiest way to do that is to alias the hostname in /etc/hosts or DNS.

     

    jdbc:oracle:thin:@hostaliasA:1521:ORCL

    jdbc:oracle:thin:@hostaliasB:1521:ORCL

     

    where ip_addr(hostaliasA) == ip_addr(hostaliasB) should work.

     

    The second issue is to do with attempting to enlist a new resource into a transaction that's marked rollback only. That's common in hibernate apps where something has gone wrong and you try to render a response in the scope of the failed tx, which causes lazy loading to occur. It's not a bug - the spec requires that rollback only tx don't enlist new resources. Either use hibernate in 'grab a connection and keep it for the whole tx' mode rather than the default 'aggressive release and reacquire on each load' mode, avoid lazy loading, or ditch the rollbackonly tx and open a new one for the view processing. And yes, all of those options are a pain.