Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Two phase commit problem  RSS feed

 
jeff mutonho
Ranch Hand
Posts: 271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have a method which , just before returning , uses two entity beans to populate two oracle database tables.The method looks like this:
public void addServices(long id , String version.....){
//do stuff here
//.....
geoLocalPopulator.insertGeoLocal(id);
siteService.create();
}
geoLocalPopulator.insertGeoLocal(id) uses an entity bean to populate a table on an oracle database.
siteService.create() also uses another (different) entity bean to populate another table on the same oracle database.Both datasources are defined as oracle.jdbc.xa.client.OracleXADataSource.I'm getting the following exception when I try to insert data into the datasources.
java.sql.SQLException: ORA-00603: ORACLE server session terminated by fatal error
ORA-02051: another session in same transaction failed
ORA-02051: another session in same transaction failed
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1446)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1371)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1900)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:407)
at oracle.jdbc.xa.client.OracleXAResource.end(OracleXAResource.java:265)
at com.ibm.ejs.jts.jta.XARminst.endAssociation(XARminst.java:365)
at com.ibm.ejs.jts.jta.portable.JTAXAResourceImpl.completionPreinvoke(JTAXAResourceImpl.java:707)
at com.ibm.ejs.jts.jta.portable.JTAXAResourceImpl.prepare(JTAXAResourceImpl.java:414)
at com.ibm.ejs.jts.jts.ResourceVector.deliverPrepare(ResourceVector.java:209)
at com.ibm.ejs.jts.jts.ResourceVector.beforePrepare(ResourceVector.java:185)
at com.ibm.ejs.jts.tran.EventCallback.executeCallback(EventCallback.java:161)
at com.ibm.ejs.jts.tran.EventCallback.executeCallbackTree(EventCallback.java:132)
at com.ibm.ejs.jts.tran.EventCallback.executeCallbackTree(EventCallback.java:123)
at com.ibm.ejs.jts.tran.EventPrepare.ExecuteBeforePrepareCallbacks(EventPrepare.java:302)
at com.ibm.ejs.jts.tran.EventPrepare.event_LocalPrepareWork(EventPrepare.java:277)
at com.ibm.ejs.jts.tran.EventPrepare.event_BecomeCoordinator(EventPrepare.java:960)
at com.ibm.ejs.jts.tran.EventControl.event_EndTopLevel(EventControl.java:295)
at com.ibm.ejs.jts.tran.TrecInterface.end(TrecInterface.java:88)
at com.ibm.ejs.jts.jts.TerminatorImpl.commit(TerminatorImpl.java:89)
at com.ibm.ejs.jts.jts.CurrentImpl.commit(CurrentImpl.java:200)
at com.ibm.ejs.jts.jts.CurrentSet.commit(CurrentSet.java:256)
at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:190)
at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:67)
at com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.java:443)
at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:1840)
at net.msl.stackdates.session.message.EJSRemoteStatelessMessageService_d9901358.addService(EJSRemoteStatelessMessageService_d9901358.java:155)
at net.msl.stackdates.session.message._MessageService_Stub.addService(_MessageService_Stub.java:417)
at net.msl.stackdates.session.message.queuehelper.ServiceCommandHandler.addService(ServiceCommandHandler.java:48)
at net.msl.stackdates.session.message.queuehelper.ServiceCommandHandler.handle(ServiceCommandHandler.java:86)
at net.msl.stackdates.session.message.queuehelper.MessageHandler.handle(MessageHandler.java:56)
at net.msl.stackdates.session.message.queuehelper.QListenerThread.run(QListenerThread.java:90)
Whe I comment out geoLocalPopulator.insertGeoLocal(id);
I don't get an exception and siteService.create(); succeeds in inserting data in the table.Commenting out only siteService.create(); , the exception is thrown.
jeff mutonho
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm. Have you triple-checked your transaction attributes for the entity bean(s)?
 
jeff mutonho
Ranch Hand
Posts: 271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes , everything is set on "required"
jeff
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!