aspose file tools*
The moose likes Websphere and the fly likes Help! Reg local and global transactions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Help! Reg local and global transactions" Watch "Help! Reg local and global transactions" New topic
Author

Help! Reg local and global transactions

Chandrakanth Belde
Greenhorn

Joined: Dec 01, 2004
Posts: 15
Hi,

I am working on task of making my product to deploy and run on websphere app server version 6. I am getting this following exception while calling conn.preparedStatement(sqlstr). This is in latest Trail version of Websphere 6 . in earlier version of this(i.e., in Developer version it has not came).
[1/21/05 19:36:20:812 IST] 00000058 MCWrapper E J2CA0081E: Method cleanup failed while trying to execute method cleanup on ManagedConnection WSRdbManagedConnectionImpl@1cc2c726 from resource jdbc/BBEDataSource. 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>(DataStor eAdapterException.java:224)
at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.<init>(DataStor eAdapterException.java:175)
at com.ibm.ws.rsadapter.AdapterUtil.createDataStoreAdapterException(AdapterUtil.ja va:232)
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.cleanupTransactions(WSRdbMa nagedConnectionImpl.java:3262)
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.cleanup(WSRdbManagedConnect ionImpl.java:2902)
at com.ibm.ejs.j2c.MCWrapper.cleanup(MCWrapper.java:1331)
at com.ibm.ejs.j2c.poolmanager.FreePool.cleanupAndDestroyMCWrapper(FreePool.java:6 18)
at com.ibm.ejs.j2c.poolmanager.FreePool.returnToFreePool(FreePool.java:427)
at com.ibm.ejs.j2c.poolmanager.PoolManager.release(PoolManager.java:1471)
at com.ibm.ejs.j2c.MCWrapper.releaseToPoolManager(MCWrapper.java:1860)
at com.ibm.ejs.j2c.LocalTransactionWrapper.enlist(LocalTransactionWrapper.java:662 )
at com.ibm.ejs.j2c.ConnectionEventListener.localTransactionStarted(ConnectionEvent Listener.java:574)
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.processLocalTransactionStar tedEvent(WSRdbManagedConnectionImpl.java:1660)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.beginLocalTransactionIfNecessary(WSJ dbcConnection.java:447)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.beginTransactionIfNecessary(WSJdbcCo nnection.java:608)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.ja va:1827)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.ja va:1782)
at com.stc.eindex.ops.ObjectPersistenceService.getStatement(ObjectPersistenceServi ce.java:74)
at com.stc.eindex.ops.EnterpriseDB.get(EnterpriseDB.java:108)
at com.stc.eindex.ejb.ops.TransactionMgrBean.getEnterpriseObject(TransactionMgrBea n.java:112)
at com.stc.eindex.ejb.ops.EJSLocalStatelessTransactionMgrEJB_a5d56077.getEnterpris eObject(Unknown Source)
at com.stc.eindex.ejb.master.MasterControllerEJB.getEnterpriseObject(MasterControl lerEJB.java:298)
at com.stc.eindex.ejb.master.EJSRemoteStatelessMasterController_c7831b90.getEnterp riseObject(Unknown Source)
at com.stc.eindex.ejb.master._MasterController_Stub.getEnterpriseObject(_MasterCon troller_Stub.java:608)
at com.stc.eindex.qws.forms.EOViewEditForm.setEuid(EOViewEditForm.java:767)
at com.stc.eindex.qws.forms.EOViewEditForm.processAction(EOViewEditForm.java:984)
at com.stc.eindex.qws.actions.LeaveEOViewEditAction.doPerform(LeaveEOViewEditActio n.java:94)
at com.stc.eindex.qws.actions.QwsBaseAction.execute(QwsBaseAction.java:123)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor .java:446)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:266)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212 )
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.jav a:629)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletW rapper.java:80)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1657)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpI nboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpI nboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCa llback.java:94)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.j ava:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:60 1)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:93 4)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1 021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)

[1/21/05 19:36:20:875 IST] 00000058 LocalTransact E J2CA0030E: Method enlist caught java.lang.IllegalStateException: Cannot enlist Resource for cleanup. A Global transaction is active. at com.ibm.ws.LocalTransaction.LocalTranCoordImpl.enlistForCleanup(LocalTranCoordI mpl.java:489)
at com.ibm.ejs.j2c.LocalTransactionWrapper.enlist(LocalTransactionWrapper.java:646 )
at com.ibm.ejs.j2c.ConnectionEventListener.localTransactionStarted(ConnectionEvent Listener.java:574)
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.processLocalTransactionStar tedEvent(WSRdbManagedConnectionImpl.java:1660)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.beginLocalTransactionIfNecessary(WSJ dbcConnection.java:447)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.beginTransactionIfNecessary(WSJdbcCo nnection.java:608)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.ja va:1827)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.ja va:1782)
at com.stc.eindex.ops.ObjectPersistenceService.getStatement(ObjectPersistenceServi ce.java:74)
at com.stc.eindex.ops.EnterpriseDB.get(EnterpriseDB.java:108)
at com.stc.eindex.ejb.ops.TransactionMgrBean.getEnterpriseObject(TransactionMgrBea n.java:112)
at com.stc.eindex.ejb.ops.EJSLocalStatelessTransactionMgrEJB_a5d56077.getEnterpris eObject(Unknown Source)
at com.stc.eindex.ejb.master.MasterControllerEJB.getEnterpriseObject(MasterControl lerEJB.java:298)
at com.stc.eindex.ejb.master.EJSRemoteStatelessMasterController_c7831b90.getEnterp riseObject(Unknown Source)
at com.stc.eindex.ejb.master._MasterController_Stub.getEnterpriseObject(_MasterCon troller_Stub.java:608)
at com.stc.eindex.qws.forms.EOViewEditForm.setEuid(EOViewEditForm.java:767)
at com.stc.eindex.qws.forms.EOViewEditForm.processAction(EOViewEditForm.java:984)
at com.stc.eindex.qws.actions.LeaveEOViewEditAction.doPerform(LeaveEOViewEditActio n.java:94)
at com.stc.eindex.qws.actions.QwsBaseAction.execute(QwsBaseAction.java:123)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor .java:446)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:266)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212 )
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.jav a:629)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletW rapper.java:80)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1657)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpI nboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpI nboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCa llback.java:94)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.j ava:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:60 1)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:93 4)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1 021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)
while trying to enlist resources from datasource jdbc/BBEDataSource with the Transaction Manager for the current transaction, and threw a Exception.
[1/21/05 19:36:20:938 IST] 00000058 ConnectionEve E J2CA0074E: Unable to enlist connection from resource jdbc/BBEDataSource with current transaction in method localTransactionStarted due to exception. Initiating destruction of connection. Exception is: javax.resource.ResourceException: enlist: caught Exception
at com.ibm.ejs.j2c.LocalTransactionWrapper.enlist(LocalTransactionWrapper.java:666 )
at com.ibm.ejs.j2c.ConnectionEventListener.localTransactionStarted(ConnectionEvent Listener.java:574)
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.processLocalTransactionStar tedEvent(WSRdbManagedConnectionImpl.java:1660)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.beginLocalTransactionIfNecessary(WSJ dbcConnection.java:447)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.beginTransactionIfNecessary(WSJdbcCo nnection.java:608)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.ja va:1827)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.ja va:1782)
at com.stc.eindex.ops.ObjectPersistenceService.getStatement(ObjectPersistenceServi ce.java:74)
at com.stc.eindex.ops.EnterpriseDB.get(EnterpriseDB.java:108)
at com.stc.eindex.ejb.ops.TransactionMgrBean.getEnterpriseObject(TransactionMgrBea n.java:112)
at com.stc.eindex.ejb.ops.EJSLocalStatelessTransactionMgrEJB_a5d56077.getEnterpris eObject(Unknown Source)
at com.stc.eindex.ejb.master.MasterControllerEJB.getEnterpriseObject(MasterControl lerEJB.java:298)
at com.stc.eindex.ejb.master.EJSRemoteStatelessMasterController_c7831b90.getEnterp riseObject(Unknown Source)
at com.stc.eindex.ejb.master._MasterController_Stub.getEnterpriseObject(_MasterCon troller_Stub.java:608)
at com.stc.eindex.qws.forms.EOViewEditForm.setEuid(EOViewEditForm.java:767)
at com.stc.eindex.qws.forms.EOViewEditForm.processAction(EOViewEditForm.java:984)
at com.stc.eindex.qws.actions.LeaveEOViewEditAction.doPerform(LeaveEOViewEditActio n.java:94)
at com.stc.eindex.qws.actions.QwsBaseAction.execute(QwsBaseAction.java:123)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor .java:446)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:266)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212 )
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.jav a:629)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletW rapper.java:80)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1657)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpI nboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpI nboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCa llback.java:94)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.j ava:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:60 1)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:93 4)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1 021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)
Caused by: java.lang.IllegalStateException: Cannot enlist Resource for cleanup. A Global transaction is active.
at com.ibm.ws.LocalTransaction.LocalTranCoordImpl.enlistForCleanup(LocalTranCoordI mpl.java:489)
at com.ibm.ejs.j2c.LocalTransactionWrapper.enlist(LocalTransactionWrapper.java:646 )
... 36 more

[1/21/05 19:36:21:000 IST] 00000058 ConnectionEve A J2CA0056I: The Connection Manager received a fatal connection error from the Resource Adaptor for resource jdbc/BBEDataSource. The exception which was received is null

I am using session beans with bean managed persistance. I have specified Local transaction element for every session bean in Application Extension file.
If i am not giving this element in ext file i am CSITransaction Rollback Exception..
Please help!!.
Roland Barcia
author
Ranch Hand

Joined: Apr 15, 2004
Posts: 177
I need more information. But you should not be using Local transaction settings. Use Container Managed Transaction. WAS will make sure it only does a one phase commit for a single resource.


Roland Barcia<br />STSM - ISSW Lead Web 2.0 Architect
Chandrakanth Belde
Greenhorn

Joined: Dec 01, 2004
Posts: 15
I am using LocalTransaction settings. I have specified it in Application Extension file like this.

<ejbExtensions xmi:type="ejbext:SessionExtension" xmi:id="Session_1106378940859" activitySessionType="Bean">
<enterpriseBean xmi:type="ejb:Session" href="META-INF/ejb-jar.xml#Session_1106378940859"/>
<beanCache xmi:id="BeanCache_1106378940859" activateAt="TRANSACTION" loadAt="TRANSACTION"/>
<localTransaction xmi:id="LocalTransaction_1106378940859" unresolvedAction="Commit" resolver="Application"/>
</ejbExtensions>
Chandrakanth Belde
Greenhorn

Joined: Dec 01, 2004
Posts: 15
localTransaction xmi:id="LocalTransaction_1106378940859" unresolvedAction="Commit" resolver="Application"
Roland Barcia
author
Ranch Hand

Joined: Apr 15, 2004
Posts: 177
Theose settings are specific to running code in what the EJB specificaiton calls "unspecified context." This is what happens when using code in the web container or in EJB methods specificed as Bean Managed TRANSACTIONS, Never, NotSupported, or Supported when the caller is non transactional. It also specific when you allow demaraction of transactions by using auto-commit option directly in JDBC (or JMS session). If you use UserTransaction or Container Managed Transactions (Requires or RequiresNew), these local Tx setting are irelevant. You should rely on the WAS Gloabl transaciton manager. if you are concerned about performence. WAS will only do a 1pc for transacitons that use one resource.
Chandrakanth Belde
Greenhorn

Joined: Dec 01, 2004
Posts: 15
Hi,

Thanks for the reply. I am using BeanManaged Transactions(BMT) and a single data resource i.e., Oracle 9i.

I have seen a tag regarding Global Transactions in Application Extension file will it help in any context to my case.
-->globalTransaction xmi:id="GlobalTransaction_1101294020343" componentTransactionTimeout="100"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help! Reg local and global transactions
 
Similar Threads
Distributed Tr mgmt
Accessing 2 CMPs which connected to 2 databases from the same session bean method...
WSAD 5.1 using CMR . hasNext() method of LinkSet$Itr throws IllegalStateExce
Problem with WAS 5.1
EJB transaction - issue with two-phase commit