public void failedOperation(DbOperation operation) { if (operation instanceof DbEntityOperation) { DbEntityOperation dbEntityOperation = (DbEntityOperation) operation; DbEntity dbEntity = dbEntityOperation.getEntity(); boolean failedOperationEntityInList = false; Iterator<LockedExternalTask> it = tasks.iterator(); while (it.hasNext()) { LockedExternalTask resultTask = it.next(); if (resultTask.getId().equals(dbEntity.getId())) { it.remove(); failedOperationEntityInList = true; break; } } if (!failedOperationEntityInList) { throw LOG.concurrentUpdateDbEntityException(operation); } } } });
public void failedOperation(DbOperation operation) { if (operation instanceof DbEntityOperation) { DbEntityOperation dbEntityOperation = (DbEntityOperation) operation; DbEntity dbEntity = dbEntityOperation.getEntity(); boolean failedOperationEntityInList = false; Iterator<LockedExternalTask> it = tasks.iterator(); while (it.hasNext()) { LockedExternalTask resultTask = it.next(); if (resultTask.getId().equals(dbEntity.getId())) { it.remove(); failedOperationEntityInList = true; break; } } if (!failedOperationEntityInList) { throw LOG.concurrentUpdateDbEntityException(operation); } } } });
protected void handleOptimisticLockingException(DbOperation dbOperation) { boolean isHandled = false; if(optimisticLockingListeners != null) { for (OptimisticLockingListener optimisticLockingListener : optimisticLockingListeners) { if(optimisticLockingListener.getEntityType() == null || optimisticLockingListener.getEntityType().isAssignableFrom(dbOperation.getEntityType())) { optimisticLockingListener.failedOperation(dbOperation); isHandled = true; } } } if (!isHandled && Context.getProcessEngineConfiguration().isSkipHistoryOptimisticLockingExceptions()) { DbEntity dbEntity = ((DbEntityOperation) dbOperation).getEntity(); if (dbEntity instanceof HistoricEntity || isHistoricByteArray(dbEntity)) { isHandled = true; } } if(!isHandled) { throw LOG.concurrentUpdateDbEntityException(dbOperation); } }
protected void handleOptimisticLockingException(DbOperation dbOperation) { boolean isHandled = false; if(optimisticLockingListeners != null) { for (OptimisticLockingListener optimisticLockingListener : optimisticLockingListeners) { if(optimisticLockingListener.getEntityType() == null || optimisticLockingListener.getEntityType().isAssignableFrom(dbOperation.getEntityType())) { optimisticLockingListener.failedOperation(dbOperation); isHandled = true; } } } if (!isHandled && Context.getProcessEngineConfiguration().isSkipHistoryOptimisticLockingExceptions()) { DbEntity dbEntity = ((DbEntityOperation) dbOperation).getEntity(); if (dbEntity instanceof HistoricEntity || isHistoricByteArray(dbEntity)) { isHandled = true; } } if(!isHandled) { throw LOG.concurrentUpdateDbEntityException(dbOperation); } }
public void failedOperation(DbOperation operation) { if (operation instanceof DbEntityOperation) { DbEntityOperation dbEntityOperation = (DbEntityOperation) operation; DbEntity dbEntity = dbEntityOperation.getEntity(); boolean failedOperationEntityInList = false; Iterator<LockedExternalTask> it = tasks.iterator(); while (it.hasNext()) { LockedExternalTask resultTask = it.next(); if (resultTask.getId().equals(dbEntity.getId())) { it.remove(); failedOperationEntityInList = true; break; } } if (!failedOperationEntityInList) { throw LOG.concurrentUpdateDbEntityException(operation); } } } });
protected void handleOptimisticLockingException(DbOperation dbOperation) { boolean isHandled = false; if(optimisticLockingListeners != null) { for (OptimisticLockingListener optimisticLockingListener : optimisticLockingListeners) { if(optimisticLockingListener.getEntityType() == null || optimisticLockingListener.getEntityType().isAssignableFrom(dbOperation.getEntityType())) { optimisticLockingListener.failedOperation(dbOperation); isHandled = true; } } } if (!isHandled && Context.getProcessEngineConfiguration().isSkipHistoryOptimisticLockingExceptions()) { DbEntity dbEntity = ((DbEntityOperation) dbOperation).getEntity(); if (dbEntity instanceof HistoricEntity || isHistoricByteArray(dbEntity)) { isHandled = true; } } if(!isHandled) { throw LOG.concurrentUpdateDbEntityException(dbOperation); } }