Examples of OptimisticLockingFailureException


Examples of org.springframework.dao.OptimisticLockingFailureException

      // Avoid concurrent modifications...
      if (count == 0) {
        int curentVersion = getJdbcTemplate().queryForObject(getQuery(CURRENT_VERSION_JOB_EXECUTION), Integer.class,
            new Object[] { jobExecution.getId() });
        throw new OptimisticLockingFailureException("Attempt to update job execution id="
            + jobExecution.getId() + " with wrong version (" + jobExecution.getVersion()
            + "), where current version is " + curentVersion);
      }

      jobExecution.incrementVersion();
View Full Code Here

Examples of org.springframework.dao.OptimisticLockingFailureException

    final StepExecution persistedExecution = executionsByStepExecutionId.get(stepExecution.getId());
    Assert.notNull(persistedExecution, "step execution is expected to be already saved");

    synchronized (stepExecution) {
      if (!persistedExecution.getVersion().equals(stepExecution.getVersion())) {
        throw new OptimisticLockingFailureException("Attempt to update step execution id="
            + stepExecution.getId() + " with wrong version (" + stepExecution.getVersion()
            + "), where current version is " + persistedExecution.getVersion());
      }

      stepExecution.incrementVersion();
View Full Code Here

Examples of org.springframework.dao.OptimisticLockingFailureException

    JobExecution persistedExecution = executionsById.get(id);
    Assert.notNull(persistedExecution, "JobExecution must already be saved");

    synchronized (jobExecution) {
      if (!persistedExecution.getVersion().equals(jobExecution.getVersion())) {
        throw new OptimisticLockingFailureException("Attempt to update step execution id=" + id
            + " with wrong version (" + jobExecution.getVersion() + "), where current version is "
            + persistedExecution.getVersion());
      }
      jobExecution.incrementVersion();
      executionsById.put(id, copy(jobExecution));
View Full Code Here

Examples of org.springframework.dao.OptimisticLockingFailureException

      // Avoid concurrent modifications...
      if (count == 0) {
        int curentVersion = getJdbcTemplate().queryForObject(getQuery(CURRENT_VERSION_STEP_EXECUTION),
            new Object[] { stepExecution.getId() }, Integer.class);
        throw new OptimisticLockingFailureException("Attempt to update step execution id="
            + stepExecution.getId() + " with wrong version (" + stepExecution.getVersion()
            + "), where current version is " + curentVersion);
      }

      stepExecution.incrementVersion();
View Full Code Here

Examples of org.springframework.dao.OptimisticLockingFailureException

        WriteResult writeResult = writeConcernToUse == null ? collection.update(queryObj, updateObj, upsert, multi)
            : collection.update(queryObj, updateObj, upsert, multi, writeConcernToUse);

        if (entity != null && entity.hasVersionProperty() && !multi) {
          if (writeResult.getN() == 0 && dbObjectContainsVersionProperty(queryObj, entity)) {
            throw new OptimisticLockingFailureException("Optimistic lock exception on saving entity: "
                + updateObj.toMap().toString() + " to collection " + collectionName);
          }
        }

        handleAnyWriteResultErrors(writeResult, queryObj, MongoActionOperation.UPDATE);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.