db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johan Hoogenboezem" <hooge...@worldonline.co.za>
Subject Derby XA, Hibernate 2.1.6, WebSphere 5.1 - Server returned XAER_NOTA at commit time
Date Tue, 13 Sep 2005 06:41:17 GMT
Hi,
I'm using Derby 10.1.1.0 with derbyclient in a WebSphere 5.1 server
environment. Here's the first part of the console output that shows some
versioning info:

****************************************************************************
**Start
WebSphere Platform 5.1 [BASE 5.1.0.3 cf30412.02] [JDK 1.4.1 b0344.02]
running with process name localhost\localhost\server1 and process id 2304
Host Operating System is Windows XP, version 5.1
Java version = J2RE 1.4.1 IBM Windows 32 build cn1411-20031011 (JIT enabled:
jitc), Java Compiler = jitc, Java VM name = Classic VM
...
...
****************************************************************************
**End

I've set up a data source using org.apache.derby.jdbc.ClientXADataSource.
Hibernate is configured as follows:

****************************************************************************
**Start
hibernate.connection.datasource = java:comp/env/jdbc/DefaultDS
hibernate.transaction.factory_class=net.sf.hibernate.transaction.JTATransact
ionFactory
hibernate.transaction.manager_lookup_class=net.sf.hibernate.transaction.WebS
phereTransactionManagerLookup
hibernate.dialect=net.sf.hibernate.dialect.DB2Dialect
hibernate.connection.username=APP
hibernate.connection.password=APP
hibernate.show_sql=false
****************************************************************************
**End

I get the current session from a ThreadLocal variable, so that in the
context of the current thread, anything asking for a hibernate session will
get the same session. I'm using Stateless Session Beans and Message Driven
Beans. Specifically in this instance I'm using an MDB with WebSphere MQ as
the JMS implementation. The transaction is managed by the container and in a
finally clause inside the onMessage() method I call a closeCurrentSession()
utility method that just flushes and closes the hibernate session stored in
the ThreadLocal.

Everything works fine when using a datasource for DB2. However, when I
switch to Derby, I get this:

****************************************************************************
**Start
[9/13/05 8:23:49:819 CAT] 1e59f386 WSRdbXaResour E DSRA0304E:  XAException
occurred. XAException contents and details are: The cause is               :
org.apache.derby.client.am.SqlException: Error executing a
XAResource.commit(), Server returned XAER_NOTA.

[9/13/05 8:23:49:819 CAT] 1e59f386 WSRdbXaResour E DSRA0302E:  XAException
occurred.  Error code is: XAER_NOTA.  Exception is: XAER_NOTA : Error
executing a XAResource.commit(), Server returned XAER_NOTA

[9/13/05 8:23:49:889 CAT] 1e59f386 XATransaction E J2CA0027E: An exception
occurred while invoking commit on an XA Resource Adapter from dataSource
jdbc/derby/scvwebdev, within transaction ID {XID: formatId(57415344),
gtrid_length(39), bqual_length(28),
data(0000000000000002000000044c4c40cbd49eaa1530e4b7146f080d8853876c7a7365727
66572314c4c40cbd49eaa1530e4b7146f080d8853876c7a000000048333bb35)}:
org.apache.derby.client.am.XaException: XAER_NOTA : Error executing a
XAResource.commit(), Server returned XAER_NOTA
	at
org.apache.derby.client.net.NetXAResource.throwXAException(Unknown Source)
	at org.apache.derby.client.net.NetXAResource.commit(Unknown Source)
	at
com.ibm.ws.rsadapter.spi.WSRdbXaResourceImpl.commit(WSRdbXaResourceImpl.java
:182)
	at
com.ibm.ejs.j2c.XATransactionWrapper.commit(XATransactionWrapper.java:432)
	at
com.ibm.ws.Transaction.JTA.JTAXAResourceImpl.commit(JTAXAResourceImpl.java:2
42)
	at
com.ibm.ws.Transaction.JTA.RegisteredResources.distributeOutcome(RegisteredR
esources.java:1044)
	at
com.ibm.ws.Transaction.JTA.RegisteredResources.distributeCommit(RegisteredRe
sources.java:1555)
	at
com.ibm.ws.Transaction.JTA.TransactionImpl.internalCommit(TransactionImpl.ja
va:1432)
	at
com.ibm.ws.Transaction.JTA.TransactionImpl.commit(TransactionImpl.java:1012)
	at
com.ibm.ws.Transaction.JTA.TranManagerImpl.commit(TranManagerImpl.java:150)
	at
com.ibm.ws.Transaction.JTA.TranManagerSet.commit(TranManagerSet.java:182)
	at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:712)
	at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:167)
	at
com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.jav
a:565)
	at
com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:3038)
	at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:102)
	at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:127)
	at
com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:372)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
Caused by: org.apache.derby.client.am.SqlException: Error executing a
XAResource.commit(), Server returned XAER_NOTA
	at
org.apache.derby.client.net.NetXAResource.xaRetValErrorAccumSQL(Unknown
Source)
	... 18 more
.

[9/13/05 8:23:50:039 CAT] 1e59f386 MCWrapper     E J2CA0081E: Method cleanup
failed while trying to execute method cleanup on ManagedConnection
com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl@30083383 from resource
jdbc/derby/scvwebdev. Caught exception: com.ibm.ws.exception.WsException:
DSRA0080E: An exception was received by the Data Store Adapter. See original
exception message: Cannot call 'cleanup' on a ManagedConnection while it is
still in a transaction..
	at
com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.<init>(DataStoreAd
apterException.java:217)
	at
com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.<init>(DataStoreAd
apterException.java:171)
	at
com.ibm.ws.rsadapter.AdapterUtil.createDataStoreAdapterException(AdapterUtil
.java:208)
	at
com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.cleanupTransactions(WSRd
bManagedConnectionImpl.java:2508)
	at
com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.cleanup(WSRdbManagedConn
ectionImpl.java:2243)
	at com.ibm.ejs.j2c.MCWrapper.cleanup(MCWrapper.java:1177)
	at
com.ibm.ejs.j2c.poolmanager.FreePool.returnToFreePool(FreePool.java:292)
	at
com.ibm.ejs.j2c.poolmanager.PoolManager.release(PoolManager.java:1251)
	at
com.ibm.ejs.j2c.MCWrapper.releaseToPoolManager(MCWrapper.java:1684)
	at
com.ibm.ejs.j2c.XATransactionWrapper.afterCompletionCode(XATransactionWrappe
r.java:359)
	at
com.ibm.ejs.j2c.XATransactionWrapper.afterCompletion(XATransactionWrapper.ja
va:300)
	at
com.ibm.ws.Transaction.JTA.RegisteredSyncs.distributeAfter(RegisteredSyncs.j
ava:161)
	at
com.ibm.ws.Transaction.JTA.TransactionImpl.distributeAfter(TransactionImpl.j
ava:2344)
	at
com.ibm.ws.Transaction.JTA.RegisteredResources.distributeCommit(RegisteredRe
sources.java:1567)
	at
com.ibm.ws.Transaction.JTA.TransactionImpl.internalCommit(TransactionImpl.ja
va:1432)
	at
com.ibm.ws.Transaction.JTA.TransactionImpl.commit(TransactionImpl.java:1012)
	at
com.ibm.ws.Transaction.JTA.TranManagerImpl.commit(TranManagerImpl.java:150)
	at
com.ibm.ws.Transaction.JTA.TranManagerSet.commit(TranManagerSet.java:182)
	at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:712)
	at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:167)
	at
com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.jav
a:565)
	at
com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:3038)
	at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:102)
	at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:127)
	at
com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:372)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)


[9/13/05 8:23:50:290 CAT] 1e59f386 WSRdbManagedC W DSRA0180W: Exception
detected during ManagedConnection.destroy().  The exception is:
com.ibm.ws.exception.WsException: DSRA0080E: An exception was received by
the Data Store Adapter. See original exception message: Cannot call
'cleanup' on a ManagedConnection while it is still in a transaction..
	at
com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.<init>(DataStoreAd
apterException.java:217)
	at
com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.<init>(DataStoreAd
apterException.java:171)
	at
com.ibm.ws.rsadapter.AdapterUtil.createDataStoreAdapterException(AdapterUtil
.java:208)
	at
com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.cleanupTransactions(WSRd
bManagedConnectionImpl.java:2508)
	at
com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.destroy(WSRdbManagedConn
ectionImpl.java:1966)
	at com.ibm.ejs.j2c.MCWrapper.destroy(MCWrapper.java:1327)
	at
com.ibm.ejs.j2c.poolmanager.FreePool.returnToFreePool(FreePool.java:305)
	at
com.ibm.ejs.j2c.poolmanager.PoolManager.release(PoolManager.java:1251)
	at
com.ibm.ejs.j2c.MCWrapper.releaseToPoolManager(MCWrapper.java:1684)
	at
com.ibm.ejs.j2c.XATransactionWrapper.afterCompletionCode(XATransactionWrappe
r.java:359)
	at
com.ibm.ejs.j2c.XATransactionWrapper.afterCompletion(XATransactionWrapper.ja
va:300)
	at
com.ibm.ws.Transaction.JTA.RegisteredSyncs.distributeAfter(RegisteredSyncs.j
ava:161)
	at
com.ibm.ws.Transaction.JTA.TransactionImpl.distributeAfter(TransactionImpl.j
ava:2344)
	at
com.ibm.ws.Transaction.JTA.RegisteredResources.distributeCommit(RegisteredRe
sources.java:1567)
	at
com.ibm.ws.Transaction.JTA.TransactionImpl.internalCommit(TransactionImpl.ja
va:1432)
	at
com.ibm.ws.Transaction.JTA.TransactionImpl.commit(TransactionImpl.java:1012)
	at
com.ibm.ws.Transaction.JTA.TranManagerImpl.commit(TranManagerImpl.java:150)
	at
com.ibm.ws.Transaction.JTA.TranManagerSet.commit(TranManagerSet.java:182)
	at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:712)
	at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:167)
	at
com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.jav
a:565)
	at
com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:3038)
	at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:102)
	at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:127)
	at
com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:372)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
.

[9/13/05 8:23:50:340 CAT] 1e59f386 MCWrapper     E J2CA0081E: Method destroy
failed while trying to execute method destroy on ManagedConnection
com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl@30083383 from resource
No longer available. Caught exception: com.ibm.ws.exception.WsException:
DSRA0080E: An exception was received by the Data Store Adapter. See original
exception message: Cannot call 'cleanup' on a ManagedConnection while it is
still in a transaction..
	at
com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.<init>(DataStoreAd
apterException.java:217)
	at
com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.<init>(DataStoreAd
apterException.java:171)
	at
com.ibm.ws.rsadapter.AdapterUtil.createDataStoreAdapterException(AdapterUtil
.java:208)
	at
com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.cleanupTransactions(WSRd
bManagedConnectionImpl.java:2508)
	at
com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.destroy(WSRdbManagedConn
ectionImpl.java:1966)
	at com.ibm.ejs.j2c.MCWrapper.destroy(MCWrapper.java:1327)
	at
com.ibm.ejs.j2c.poolmanager.FreePool.returnToFreePool(FreePool.java:305)
	at
com.ibm.ejs.j2c.poolmanager.PoolManager.release(PoolManager.java:1251)
	at
com.ibm.ejs.j2c.MCWrapper.releaseToPoolManager(MCWrapper.java:1684)
	at
com.ibm.ejs.j2c.XATransactionWrapper.afterCompletionCode(XATransactionWrappe
r.java:359)
	at
com.ibm.ejs.j2c.XATransactionWrapper.afterCompletion(XATransactionWrapper.ja
va:300)
	at
com.ibm.ws.Transaction.JTA.RegisteredSyncs.distributeAfter(RegisteredSyncs.j
ava:161)
	at
com.ibm.ws.Transaction.JTA.TransactionImpl.distributeAfter(TransactionImpl.j
ava:2344)
	at
com.ibm.ws.Transaction.JTA.RegisteredResources.distributeCommit(RegisteredRe
sources.java:1567)
	at
com.ibm.ws.Transaction.JTA.TransactionImpl.internalCommit(TransactionImpl.ja
va:1432)
	at
com.ibm.ws.Transaction.JTA.TransactionImpl.commit(TransactionImpl.java:1012)
	at
com.ibm.ws.Transaction.JTA.TranManagerImpl.commit(TranManagerImpl.java:150)
	at
com.ibm.ws.Transaction.JTA.TranManagerSet.commit(TranManagerSet.java:182)
	at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:712)
	at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:167)
	at
com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.jav
a:565)
	at
com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:3038)
	at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:102)
	at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:127)
	at
com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:372)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
****************************************************************************
**End

Any help with this will be greatly appreciated. I'm in the process of
converting all my team members to Derby, so this is a real show-stopper for
us.

Regards
Johan Hoogenboezem
IZAZI Solutions (Pty) Limited | 57 6th Road | Hyde Park | Johannesburg |
South Africa
tel: + 27 11 788 0333 | mobile: +27 83 296 2360 | fax: + 27 11 788 2630
e-mail: johanh@izazi.com | web: www.izazi.com 
DISCLAIMER This message is intended for the addressee only, as it contains
information that is privileged, private and confidential. If you are not the
intended recipient of this message, you are notified that any distribution,
use or copying of this communication is strictly prohibited. If you have
received this communication in error, please notify the sender immediately



Mime
View raw message