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

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

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

origin: com.haulmont.thirdparty/eclipselink

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

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

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

/**
 * INTERNAL:
 * Check the row count for lock failure.
 */
public void validateDelete(int rowCount, Object object, DeleteObjectQuery 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.objectChangedSinceLastReadWhenDeleting(object, query);
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Check the row count for lock failure.
 */
public void validateDelete(int rowCount, Object object, DeleteObjectQuery 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.objectChangedSinceLastReadWhenDeleting(object, query);
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Check the row count for lock failure.
 */
public void validateDelete(int rowCount, Object object, DeleteObjectQuery 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.objectChangedSinceLastReadWhenDeleting(object, query);
  }
}
org.eclipse.persistence.exceptionsOptimisticLockExceptionobjectChangedSinceLastReadWhenDeleting

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
  • objectChangedSinceLastReadWhenUpdating
  • setErrorCode

Popular in Java

  • Reactive rest calls using spring rest template
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setScale (BigDecimal)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • IsNull (org.hamcrest.core)
    Is the value null?
  • 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