Tabnine Logo
CacheInvalidationPolicy.shouldRefreshInvalidObjectsInUnitOfWork
Code IndexAdd Tabnine to your IDE (free)

How to use
shouldRefreshInvalidObjectsInUnitOfWork
method
in
org.eclipse.persistence.descriptors.invalidation.CacheInvalidationPolicy

Best Java code snippets using org.eclipse.persistence.descriptors.invalidation.CacheInvalidationPolicy.shouldRefreshInvalidObjectsInUnitOfWork (Showing top 2 results out of 315)

origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Check if the object is invalid and should be refreshed, return true, otherwise return false.
 * This is used to ensure that no invalid objects are registered.
 */
public boolean checkInvalidObject(Object object, CacheKey cacheKey, ClassDescriptor descriptor, UnitOfWorkImpl unitOfWork) {
  if (!unitOfWork.isNestedUnitOfWork() && (cacheKey.getObject() != null)) {
    CacheInvalidationPolicy cachePolicy = descriptor.getCacheInvalidationPolicy();
    // BUG#6671556 refresh invalid objects when accessed in the unit of work.
    return (cachePolicy.shouldRefreshInvalidObjectsInUnitOfWork() && cachePolicy.isInvalidated(cacheKey));
  }
  return false;
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Check if the object is invalid and refresh it.
 * This is used to ensure that no invalid objects are registered.
 */
public void checkInvalidObject(Object object, CacheKey cacheKey, ClassDescriptor descriptor) {
  if (!isNestedUnitOfWork() && (cacheKey.getObject() != null)) {
    CacheInvalidationPolicy cachePolicy = descriptor.getCacheInvalidationPolicy();
    // BUG#6671556 refresh invalid objects when accessed in the unit of work.
    if (cachePolicy.shouldRefreshInvalidObjectsInUnitOfWork() && cachePolicy.isInvalidated(cacheKey)) {
      ReadObjectQuery query = new ReadObjectQuery();
      query.setReferenceClass(object.getClass());
      query.setSelectionKey(cacheKey.getKey());
      query.refreshIdentityMapResult();
      query.setIsExecutionClone(true);
      parent.executeQuery(query);
    }
  }
}

org.eclipse.persistence.descriptors.invalidationCacheInvalidationPolicyshouldRefreshInvalidObjectsInUnitOfWork

Javadoc

Determines if expired object registered in the unit of work should be refreshed, default true.

Popular methods of CacheInvalidationPolicy

  • getExpiryTimeInMillis
    INTERNAL: Get the next time when this object will become invalid
  • getRemainingValidTime
    INTERNAL: Return the remaining life of this object
  • isInvalidated
  • shouldUpdateReadTimeOnUpdate
    PUBLIC: Return whether objects affected by this CacheInvalidationPolicy should have the read time on
  • clone
  • setIsInvalidationRandomized
    PUBLIC: Allows the timeToLive to be randomized to avoid bottlenecks.
  • setShouldRefreshInvalidObjectsOnClone
    PUBLIC: Set if expired object should be refreshed prior to cloning, default is true. Applies to Prot
  • setShouldUpdateReadTimeOnUpdate
    PUBLIC: Set whether to update the stored time an object was read when an object is updated. When the
  • shouldRefreshInvalidObjectsOnClone
    PUBLIC: Return if expired object should be refreshed prior to cloning. Applies to Protected Entities

Popular in Java

  • Running tasks concurrently on multiple threads
  • getResourceAsStream (ClassLoader)
  • runOnUiThread (Activity)
  • setContentView (Activity)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Option (scala)
  • CodeWhisperer alternatives
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