aspose file tools*
The moose likes BEA/Weblogic and the fly likes CMP bean commit problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "CMP bean commit problem" Watch "CMP bean commit problem" New topic
Author

CMP bean commit problem

Billy Tsai
Ranch Hand

Joined: May 23, 2003
Posts: 1304
We have a CMP stateless session bean which has transaction commit problem.
The internal sequence of our API is like follows:
1. queried Oracle data via DAO
2. called third party session bean API to set information
3. return the result to client
Environment Brief:
Oracle is 8.1.7
WebLogic is 6.1 sp3
Run on Sun OS 5.8
Third party beans using same WebLogic server but has its security reamls.
The normal response time of our API is within 5 sec. The timeout time is about 120 sec.
From the logs, step 1 and 2 were done fine and ready to return the result. Client can get its result normally when test on customer�s testing environment or if remove the transaction control. Nevertheless, it finished whole works but throws TimeoutException at one of our customers production servers randomly without any other errors. We checked all 3 servers� configuration. They are similar or same. The only different is IP and port numbers.
We moved the AP server to WebLogic 8.1sp1 for test. The TimeoutException happen every time.
We think it could be the result of principle and credential change when calling the third party API. It causes the container cannot commit the original DB during this transaction.
What can we do to solve the random error if we still need to use CMP to handle the transactions?
the following is the log
<May 11, 2004 7:29:37 PM CST> <Error> <EJB> <Exception during commit of transaction Name=[EJB com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean.retvRedeemInfoList(com.fet.np.common.vo.UserVo,com.fet.np.newcash.mileage.common.vo.MilInfoIdVo)],Xid=29:c72fa81cdbd3dd0b(4741190),Status=Rolling Back. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 123 seconds
Name=[EJB com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean.retvRedeemInfoList(com.fet.np.common.vo.UserVo,com.fet.np.newcash.mileage.common.vo.MilInfoIdVo)],Xid=29:c72fa81cdbd3dd0b(4741190),Status=Active (PrePreparing),numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=123,seconds left=60,activeThread=Thread[ExecuteThread: '7' for queue: 'default',5,Thread Group for Queue: 'default'],ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=ended,assigned=none),SCInfo[MigPRD+MigPRD_NodeB]=(state=pre-prepared),SCInfo[acm416+acm416Server]=(state=pre-preparing),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPR D+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=acti ve),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_No deB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),properties=({weblogic.transaction.name=[EJB com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean.retvRedeemInfoList(com.fet.np.common.vo.UserVo,com.fet.np.newcash.mileage.common.vo.MilInfoIdVo)], weblogic.jdbc=t3://10.64.35.63:10203}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=MigPRD_NodeB+10.64.35.63:10203+MigPRD+, Resources={})],CoordinatorURL=MigPRD_NodeB+10.64.35.63:10203+MigPRD+)],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=243,seconds left=10,ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=rolledback,assigned=MigPRD_NodeB),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[acm416+acm416Server]=(state=rolling-back),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_Nod eB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[ MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=ro lledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),properties=({weblogic.transaction.name=[EJB com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean.retvRedeemInfoList(com.fet.np.common.vo.UserVo,com.fet.np.newcash.mileage.common.vo.MilInfoIdVo)], weblogic.jdbc=t3://10.64.35.63:10203}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=MigPRD_NodeB+10.64.35.63:10203+MigPRD+, Resources={})],CoordinatorURL=MigPRD_NodeB+10.64.35.63:10203+MigPRD+): weblogic.transaction.internal.TimedOutException: Transaction timed out after 123 seconds
Name=[EJB com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean.retvRedeemInfoList(com.fet.np.common.vo.UserVo,com.fet.np.newcash.mileage.common.vo.MilInfoIdVo)],Xid=29:c72fa81cdbd3dd0b(4741190),Status=Active (PrePreparing),numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=123,seconds left=60,activeThread=Thread[ExecuteThread: '7' for queue: 'default',5,Thread Group for Queue: 'default'],ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=ended,assigned=none),SCInfo[MigPRD+MigPRD_NodeB]=(state=pre-prepared),SCInfo[acm416+acm416Server]=(state=pre-preparing),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPR D+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=acti ve),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_No deB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),properties=({weblogic.transaction.name=[EJB com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean.retvRedeemInfoList(com.fet.np.common.vo.UserVo,com.fet.np.newcash.mileage.common.vo.MilInfoIdVo)], weblogic.jdbc=t3://10.64.35.63:10203}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=MigPRD_NodeB+10.64.35.63:10203+MigPRD+, Resources={})],CoordinatorURL=MigPRD_NodeB+10.64.35.63:10203+MigPRD+)
at weblogic.transaction.internal.ServerTransactionImpl.wakeUp(ServerTransactionImpl.java:1121)
at weblogic.transaction.internal.ServerTransactionManagerImpl.processTimedOutTransactions(ServerTransactionManagerImpl.java:466)
at weblogic.transaction.internal.TransactionManagerImpl.wakeUp(TransactionManagerImpl.java:1604)
at weblogic.transaction.internal.ServerTransactionManagerImpl.wakeUp(ServerTransactionManagerImpl.java:429)
at weblogic.transaction.internal.TransactionManagerImpl$1.run(TransactionManagerImpl.java:1570)
at java.lang.Thread.run(Thread.java:479)
--------------- nested within: ------------------
weblogic.transaction.RollbackException: Transaction timed out after 123 seconds
Name=[EJB com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean.retvRedeemInfoList(com.fet.np.common.vo.UserVo,com.fet.np.newcash.mileage.common.vo.MilInfoIdVo)],Xid=29:c72fa81cdbd3dd0b(4741190),Status=Active (PrePreparing),numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=123,seconds left=60,activeThread=Thread[ExecuteThread: '7' for queue: 'default',5,Thread Group for Queue: 'default'],ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=ended,assigned=none),SCInfo[MigPRD+MigPRD_NodeB]=(state=pre-prepared),SCInfo[acm416+acm416Server]=(state=pre-preparing),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPR D+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=acti ve),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_No deB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),properties=({weblogic.transaction.name=[EJB com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean.retvRedeemInfoList(com.fet.np.common.vo.UserVo,com.fet.np.newcash.mileage.common.vo.MilInfoIdVo)], weblogic.jdbc=t3://10.64.35.63:10203}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=MigPRD_NodeB+10.64.35.63:10203+MigPRD+, Resources={})],CoordinatorURL=MigPRD_NodeB+10.64.35.63:10203+MigPRD+) - with nested exception:
[weblogic.transaction.internal.TimedOutException: Transaction timed out after 123 seconds
Name=[EJB com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean.retvRedeemInfoList(com.fet.np.common.vo.UserVo,com.fet.np.newcash.mileage.common.vo.MilInfoIdVo)],Xid=29:c72fa81cdbd3dd0b(4741190),Status=Active (PrePreparing),numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=123,seconds left=60,activeThread=Thread[ExecuteThread: '7' for queue: 'default',5,Thread Group for Queue: 'default'],ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=ended,assigned=none),SCInfo[MigPRD+MigPRD_NodeB]=(state=pre-prepared),SCInfo[acm416+acm416Server]=(state=pre-preparing),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPR D+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=acti ve),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_No deB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),properties=({weblogic.transaction.name=[EJB com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean.retvRedeemInfoList(com.fet.np.common.vo.UserVo,com.fet.np.newcash.mileage.common.vo.MilInfoIdVo)], weblogic.jdbc=t3://10.64.35.63:10203}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=MigPRD_NodeB+10.64.35.63:10203+MigPRD+, Resources={})],CoordinatorURL=MigPRD_NodeB+10.64.35.63:10203+MigPRD+)]
at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1481)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:262)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:189)
at weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:272)
at com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean_9z1jv4_EOImpl.retvRedeemInfoList(RedemptionBean_9z1jv4_EOImpl.java:550)
at com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean_9z1jv4_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>

and If there is not solution to there above problem I would like to handle the transaction programmatically in client code, by obtaining UserTransaction in the session facade to handle the transaction for enterprise bean in client side instead of using BMP by writing transaction codes in enterprise bean for Weblogic8.1,
I tried to obtain the javax.transaction.Usertransaction using context.lookup but i can not get it by got an Security exception instead in the ctx.lookup code in the facade it said can't load java.lang package with Classloader, anyone know how to obtain the UserTransaction (JTA) object from Weblogic so I can handle transactions programmatically in the client side ?


BEA 8.1 Certified Administrator, IBM Certified Solution Developer For XML 1.1 and Related Technologies, SCJP, SCWCD, SCBCD, SCDJWS, SCJD, SCEA,
Oracle Certified Master Java EE 5 Enterprise Architect
Billy Tsai
Ranch Hand

Joined: May 23, 2003
Posts: 1304
By the way it is a stateless session bean that is involved in the CMP and its EJB2.0 also it will be the same bean I want to use if I want to handle the transaction programmatically in client code
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
Hi,

I've seen this happen when we have nested resultsets and pstmts and forget to close the resultsets, pstmts and connections.
Check it out.
Billy Tsai
Ranch Hand

Joined: May 23, 2003
Posts: 1304
But the result returned from the EJB is an Value Object to the facade then the VO to the webtier
Reid M. Pinchback
Ranch Hand

Joined: Jan 25, 2002
Posts: 775
This may not be easy, but see if your DAO code is using prepared statements or not. If so, try writing code for your bean that only uses regular statements, not prepared ones.

Yes, that sounds odd, but the reason I suggest it is that there was a nasty thread deadlock bug in the Oracle 8.1.6 driver that only appeared if you were using prepared statements and JDBC metadata calls on the same connection. Even if you aren't using metadata calls, it is very possible that the container uses them in a way that is invisible to you.

The only other idea that comes to mind is to change your DAO into an entity bean to see if that avoids the problem.


Reid - SCJP2 (April 2002)
 
 
subject: CMP bean commit problem