Tabnine Logo
OptimisticLockException.objectChangedSinceLastReadWhenUpdating
Code IndexAdd Tabnine to your IDE (free)

How to use
objectChangedSinceLastReadWhenUpdating
method
in
org.eclipse.persistence.exceptions.OptimisticLockException

Best Java code snippets using org.eclipse.persistence.exceptions.OptimisticLockException.objectChangedSinceLastReadWhenUpdating (Showing top 6 results out of 315)

origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Check the row count for lock failure.
 */
public void validateUpdate(int rowCount, Object object, WriteObjectQuery query) {
  if (rowCount <= 0) {
    // Mark the object as invalid in the session cache.
    query.getSession().getParentIdentityMapSession(query, true, true).getIdentityMapAccessor().invalidateObject(object);
    throw OptimisticLockException.objectChangedSinceLastReadWhenUpdating(object, query);
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Check the row count for lock failure.
 */
public void validateUpdate(int rowCount, Object object, WriteObjectQuery query) {
  if (rowCount <= 0) {
    // Mark the object as invalid in the session cache.
    query.getSession().getParentIdentityMapSession(query, true, true).getIdentityMapAccessor().invalidateObject(object);
    throw OptimisticLockException.objectChangedSinceLastReadWhenUpdating(object, query);
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Check the row count for lock failure.
 */
public void validateUpdate(int rowCount, Object object, WriteObjectQuery query) {
  if (rowCount <= 0) {
    // Mark the object as invalid in the session cache.
    query.getSession().getParentIdentityMapSession(query, true, true).getIdentityMapAccessor().invalidateObject(object);
    throw OptimisticLockException.objectChangedSinceLastReadWhenUpdating(object, query);
  }
}
origin: com.haulmont.thirdparty/eclipselink

  /**
   * INTERNAL:
   * Check the row count for lock failure.
   */
  public void validateUpdate(int rowCount, Object object, WriteObjectQuery query) {
    if (rowCount <= 0) {
      // Mark the object as invalid in the session cache, only if version is the same as in query.
      Object primaryKey = query.getPrimaryKey();
      AbstractSession session = query.getSession().getParentIdentityMapSession(query, true, true);
      CacheKey cacheKey = session.getIdentityMapAccessorInstance().getCacheKeyForObject(primaryKey, query.getReferenceClass(), query.getDescriptor(), false);
      if ((cacheKey != null) && (cacheKey.getObject() != null) && (query.getObjectChangeSet() != null)) {
        Object queryVersion = query.getObjectChangeSet().getInitialWriteLockValue();
        Object cacheVersion = getWriteLockValue(cacheKey.getObject(), primaryKey, session);
        if (compareWriteLockValues(queryVersion, cacheVersion) >= 0) {
          cacheKey.setInvalidationState(CacheKey.CACHE_KEY_INVALID);
        }
      }
      throw OptimisticLockException.objectChangedSinceLastReadWhenUpdating(object, query);
    }
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

  /**
   * INTERNAL:
   * Check the row count for lock failure.
   */
  public void validateUpdate(int rowCount, Object object, WriteObjectQuery query) {
    if (rowCount <= 0) {
      // Mark the object as invalid in the session cache, only if version is the same as in query.
      Object primaryKey = query.getPrimaryKey();
      AbstractSession session = query.getSession().getParentIdentityMapSession(query, true, true);
      CacheKey cacheKey = session.getIdentityMapAccessorInstance().getCacheKeyForObject(primaryKey, query.getReferenceClass(), query.getDescriptor(), false);
      if ((cacheKey != null) && (cacheKey.getObject() != null) && (query.getObjectChangeSet() != null)) {
        Object queryVersion = query.getObjectChangeSet().getInitialWriteLockValue();
        Object cacheVersion = getWriteLockValue(cacheKey.getObject(), primaryKey, session);
        if (compareWriteLockValues(queryVersion, cacheVersion) >= 0) {
          cacheKey.setInvalidationState(CacheKey.CACHE_KEY_INVALID);
        }
      }
      throw OptimisticLockException.objectChangedSinceLastReadWhenUpdating(object, query);
    }
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  /**
   * INTERNAL:
   * Check the row count for lock failure.
   */
  public void validateUpdate(int rowCount, Object object, WriteObjectQuery query) {
    if (rowCount <= 0) {
      // Mark the object as invalid in the session cache, only if version is the same as in query.
      Vector primaryKey = query.getPrimaryKey();
      AbstractSession session = query.getSession().getParentIdentityMapSession(query, true, true);
      CacheKey cacheKey = session.getIdentityMapAccessorInstance().getCacheKeyForObject(primaryKey, query.getReferenceClass(), query.getDescriptor());
      if ((cacheKey != null) && (cacheKey.getObject() != null) && (query.getObjectChangeSet() != null)) {
        Object queryVersion = query.getObjectChangeSet().getInitialWriteLockValue();
        Object cacheVersion = getWriteLockValue(cacheKey.getObject(), primaryKey, session);
        if (compareWriteLockValues(queryVersion, cacheVersion) >= 0) {
          cacheKey.setInvalidationState(CacheKey.CACHE_KEY_INVALID);
        }
      }
      throw OptimisticLockException.objectChangedSinceLastReadWhenUpdating(object, query);
    }
  }
}
org.eclipse.persistence.exceptionsOptimisticLockExceptionobjectChangedSinceLastReadWhenUpdating

Popular methods of OptimisticLockException

  • <init>
    INTERNAL: EclipseLink exceptions should only be thrown by EclipseLink.
  • batchStatementExecutionFailure
  • getQuery
    PUBLIC: Return the query in which the problem was detected.
  • mustHaveMappingWhenStoredInObject
  • needToMapJavaSqlTimestampWhenStoredInObject
  • noVersionNumberWhenDeleting
  • noVersionNumberWhenUpdating
  • objectChangedSinceLastMerge
  • objectChangedSinceLastReadWhenDeleting
  • setErrorCode

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSharedPreferences (Context)
  • onRequestPermissionsResult (Fragment)
  • startActivity (Activity)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Table (org.hibernate.mapping)
    A relational table
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now