Hi, I have an entity bean for which I have defined the Transaction attribute as (REQUIRES_NEW) in the deployment descriptor for all the method this is needed to prevent concurrency issues. But when I call any method on this Entity bean I get the following exception : weblogic.ejb20.locks.LockTimedOutException: The lock request from EJB:TableSequences with primary key:Maya_Test timed-out after waiting 0 ms. The transaction or thread requesting the lock was:Name=[EJB com.sanjiv.ejb.prototype.TableSequencesBeanCMP.getNextKeyAfterIncrementingBy(int)],Xid=23:64c67e8d(3716680),Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=30,seconds left=0,activeThread=Thread[ExecuteThread: '14' for queue: 'default',5,Thread Group for Queue: 'default'],SCInfo[mydomain+myserver]=(state=active),properties=({weblogic.transaction.name=[EJB com.sanjiv.ejb.prototype.TableSequencesBeanCMP.getNextKeyAfterIncrementingBy(int)]}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=myserver+135.108.1 97.166:7001+mydomain+, Resources={})]). at weblogic.ejb20.locks.ExclusiveLockManager$LockBucket.lock(ExclusiveLockManager.java:527) at weblogic.ejb20.locks.ExclusiveLockManager.lock(ExclusiveLockManager.java:258) at weblogic.ejb20.manager.ExclusiveEntityManager.acquireLock(ExclusiveEntityManager.java:164) at weblogic.ejb20.manager.ExclusiveEntityManager.getReadyBean(ExclusiveEntityManager.java:219) at weblogic.ejb20.manager.ExclusiveEntityManager.preInvoke(ExclusiveEntityManager.java:198) at weblogic.ejb20.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:117) at weblogic.ejb20.internal.EntityEJBObject.preInvoke(EntityEJBObject.java:88) at com.sanjiv.ejb.prototype.TableSequencesBeanCMP_by1d8c_EOImpl.getNextKeyAfterIncrementingBy(TableSequencesBeanCMP_by1d8c_EOImpl.java:25) at com.sanjiv.ejb.prototype.SequenceSessionBean.getNextNumberInSequence(SequenceSessionBean.java:44) at com.sanjiv.ejb.prototype.SequenceSessionBean_5gvhxn_EOImpl.getNextNumberInSequence(SequenceSessionBean_5gvhxn_EOImpl.java:37) at com.sanjiv.ejb.prototype.SessionEJBTest.insertDTO(SessionEJBTest.java:65) at com.sanjiv.ejb.prototype.SessionEJBTest_vend8n_EOImpl.insertDTO(SessionEJBTest_vend8n_EOImpl.java:37) at com.sanjiv.ejb.prototype.SessionEJBTest_vend8n_EOImpl_WLSkel.invoke(Unknown Source) at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:296) at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93) at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:265) 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)
Any suggestions, what could be going wrong? Any response is greatly appreciated. Thanks Sanjiv
Marcos Maia
Ranch Hand
Joined: Jan 06, 2001
Posts: 977
posted
0
Hi, actually to prevent concurrency using weblogic you don�t have to use REQUIRES_NEW, to do that: the �wrapper� EJB may explicitly obtain a transaction context before invoking other EJBs, or WebLogic Server may automatically create a new transaction context if the EJB�s trans-attribute element is set to Required or RequiresNew. All EJBs invoked by the wrapper EJB must be able to support the transaction context (their trans-attribute elements must be set to Required, Supports, or Mandatory). take a look at: http://e-docs.bea.com/wls/docs61/ejb/EJB_environment.html#1092031 regards.
Originally posted by Sanjiv Pansari: I have an entity bean for which I have defined the Transaction attribute as (REQUIRES_NEW) in the deployment descriptor for all the method this is needed to prevent concurrency issues. But when I call any method on this Entity bean I get the following exception :
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.