Discussions

EJB design: OptimisticConcurrencyException

  1. OptimisticConcurrencyException (1 messages)

    Hi, 

    The following error occured 
    javax.transaction.TransactionRolledbackException: BEA1-08535ED802BF1D73B672: weblogic.ejb.OptimisticConcurrencyException: [EJB:010143]Optimistic concurrency violation. Instance of bean 'CustomerEntityBean' with primary key '1091' was changed by another transaction. 

    please help resolve the above issue. 
    code :: 

    try 

    if (depositSrv == null) 

    depositSrv = new AccountModuleServiceUtil().getDepositAccountService(token); 

    depositSrv.createAndActivateDepositAccountForDefaultProduct(acctData, token); 

    catch (BusinessServiceException ex) 

    String[] params = { token.getId() }; 
    logger.logError(AccountErrorCodes.ERROR_CANNOT_CREATE_DEFAULT_DEPOSIT_ACCOUNT, 
    params, ex); 
    throw new BusinessServiceException(ex); 



    if (customerData instanceof PrivatecustomerData) 

    PrivatecustomerData data = (PrivatecustomerData) participator; 
    custServiceLocal.activatePersonalCustomer(data, token); 
    if (this.logger.isDebugEnabled()) 

    String[] params = { token.getId(), "Returning data:" + data }; 
    this.logger.logDebug(UtilModule.DEBUG_KEY_IN_METHOD, params); 

    return data; 



    As the above error happened because of version no being updated by an another transaction.. I've tried to modified the version no too.. 

    please help me out friends... 

  2. This seems to be a very[ Go to top ]

    This seems to be a very complicated issue. I am also interested to know how to fix this error. It would help me a lot shall I encounter the same issue in the future. - Michael Courouleau