EJB application fails with[EJB:010107]The lock request from EJB:XXXX with primary key:XXXX timed-out after waiting 0 ms (Doc ID 1365565.1)

Last updated on JUNE 09, 2016

Applies to:

Oracle WebLogic Server - Version 10.3 and later
Information in this document applies to any platform.

Symptoms

EJB 3.0 concurrent access of the same stateful session bean (SFSB) instance from the same client throws an exception:

 

@Stateful
@Remote(HelperSFSRemoteIntf.class)
@EJB ( name="ejb/SimpleSFSLookUp", beanInterface=SimpleSFSLocalIntf.class, beanName="SimpleSFS")
public class HelperSFSBean implements HelperSFSRemoteIntf

{
   public String concurrentAccessMethod1 (int timeToWait) throws Exception{
    Thread.sleep(timeToWait);
    return "";
}

  public String concurrentAccessMethod2 (int timeToWait) throws Exception{
  Thread.sleep(timeToWait);
  return "";
}


Define two threads and within the threads, try to invoke two different business methods of the stateful session bean using the business interface.  The following exception will be thrown:

javax.ejb.EJBException: [EJB:010107]The lock request from EJB:HelperSFS with primary key:50268885642903552 timed-out after waiting 0 ms. The transaction or thread requesting the lock was:Name=[EJB statefullejb_concurrentaccess.HelperSFSBean.concurrentAccessMethod1(int)],Xid=BEA1-001938A7BA02(7659439),Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=0,seconds left=30,activeThread=Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads],SCInfo[DefaultDomain+DefaultServer]=(state=active),properties=({weblogic.transaction.name=[EJB statefullejb_concurrentaccess.HelperSFSBean.concurrentAccessMethod1(int)]}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=DefaultServer+10.149.111.6:7101+DefaultDomain+t3+, XAResources={WSATGatewayRM_DefaultServer_DefaultDomain, Model_salaryControlServiceBCProfile@HrDS@HrDS_DefaultDomain},NonXAResources={})]).; nested exception is: weblogic.ejb20.locks.LockTimedOutException: [EJB:010107]The lock request from EJB:HelperSFS with primary key:50268885642903552 timed-out after waiting 0 ms. The transaction or thread requesting the lock was:Name=[EJB statefullejb_concurrentaccess.HelperSFSBean.concurrentAccessMethod1(int)],Xid=BEA1-001938A7BA02(7659439),Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=0,seconds left=30,activeThread=Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads],SCInfo[DefaultDomain+DefaultServer]=(state=active),properties=({weblogic.transaction.name=[EJB statefullejb_concurrentaccess.HelperSFSBean.concurrentAccessMethod1(int)]}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=DefaultServer+10.149.111.6:7101+DefaultDomain+t3+, XAResources={WSATGatewayRM_DefaultServer_DefaultDomain, Model_salaryControlServiceBCProfile@HrDS@HrDS_DefaultDomain},NonXAResources={})]).
Process exited with exit code 0.



Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms