db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanley Bradbury <Stan.Bradb...@gmail.com>
Subject Re: ask help about websphere
Date Wed, 07 Mar 2007 19:02:21 GMT
li michael wrote:
> Dear Stanley
> i'm sorry to bother you suddently but sinerely hope you can receive 
> this mail.
> i'm a software engineer and working on a project use websphere 6.0 . 
> there is a same exception in our
> project which display below with your mail when i google it.
> could you please tell me the solution for the exception?
> thanks in advance.
> Michael
> Cognizant Technique Solution
>  
>  
>  
> http://mail-archives.apache.org/mod_mbox/db-derby-user/200509.mbox/%3C43301A44.9090106@gmail.com%3E

> <http://mail-archives.apache.org/mod_mbox/db-derby-user/200509.mbox/%3C43301A44.9090106@gmail.com%3E>
>  
> From 	Stanley Bradbury <Stan.Bradb...@gmail.com 
> <mailto:Stan.Bradb...@gmail.com>>
> Subject 	Re: Derby XA, Hibernate 2.1.6, WebSphere 5.1 - Server 
> returned XAER_NOTA at commit time
> Date 	Tue, 20 Sep 2005 14:18:44 GMT
> Hi Johan -
> I will be able to look into this error more later today but wanted to 
> get this observation to you ASAP since this issue seems to have set for 
> a week.  The root cause of the failure is this exception taken from one 
> of the repeated stack traces from the MCWrapper class:
>
> original exception message: Cannot call 'cleanup' on a ManagedConnection while it is
> still in a transaction..
>
> Based on this message I recommend placing a check in your code to insure 
> there are no open transactions prior to calling cleanup.  I can't 
> explain why this would be an issue when Derby is used and not DB2 but I 
> am hoping it is as simple as doing a check and handling all open 
> transactions.
>
> Johan Hoogenboezem wrote:
>
> >Hi,
> >I'm using Derby 10.1.1.0 <http://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 <http://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)
> 	--- SNIP ---
>         
>
Hi Michael -
Is this an XA_RDONLY xact, if so please take a look at this bug report 
to see if this might be the problem you are encountering. 
http://issues.apache.org/jira/browse/DERBY-960

We never got at test case from Johan (this is often the case when 
problems happen in complex environments)  so the resolution, if any, is 
not known for the problem you cite.  DERBY-960 was identified later and 
does seem like it might be the source of the problem.  This issue is 
listed as fixed in versions:       10.2.1.6, 10.1.3.1.

Let me know if this resolves your problem.


Mime
View raw message