Tabnine Logo
TimestampLockingPolicy.storeInCache
Code IndexAdd Tabnine to your IDE (free)

How to use
storeInCache
method
in
org.eclipse.persistence.descriptors.TimestampLockingPolicy

Best Java code snippets using org.eclipse.persistence.descriptors.TimestampLockingPolicy.storeInCache (Showing top 3 results out of 315)

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

/**
 * PUBLIC:
 * Set the locking policy to use timestamp version locking.
 * This updates the timestamp field on all updates, first comparing that the field has not changed to detect locking conflicts.
 * Note: many database have limited precision of timestamps which can be an issue is highly concurrent systems.
 *
 * The parameter 'shouldStoreInCache' configures the version lock value to be stored in the cache or in the object.
 * Note: if using a stateless model where the object can be passed to a client and then later updated in a different transaction context,
 * then the version lock value should not be stored in the cache, but in the object to ensure it is the correct value for that object.
 * @see VersionLockingPolicy
 */
public void useTimestampLocking(String writeLockFieldName, boolean shouldStoreInCache) {
  TimestampLockingPolicy policy = new TimestampLockingPolicy(writeLockFieldName);
  if (shouldStoreInCache) {
    policy.storeInCache();
  } else {
    policy.storeInObject();
  }
  setOptimisticLockingPolicy(policy);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * PUBLIC:
 * Set the locking policy to use timestamp version locking.
 * This updates the timestamp field on all updates, first comparing that the field has not changed to detect locking conflicts.
 * Note: many database have limited precision of timestamps which can be an issue is highly concurrent systems.
 *
 * The parameter 'shouldStoreInCache' configures the version lock value to be stored in the cache or in the object.
 * Note: if using a stateless model where the object can be passed to a client and then later updated in a different transaction context,
 * then the version lock value should not be stored in the cache, but in the object to ensure it is the correct value for that object.
 * @see VersionLockingPolicy
 */
public void useTimestampLocking(String writeLockFieldName, boolean shouldStoreInCache) {
  TimestampLockingPolicy policy = new TimestampLockingPolicy(writeLockFieldName);
  if (shouldStoreInCache) {
    policy.storeInCache();
  } else {
    policy.storeInObject();
  }
  setOptimisticLockingPolicy(policy);
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * PUBLIC:
 * Set the locking policy to use timestamp version locking.
 * This updates the timestamp field on all updates, first comparing that the field has not changed to detect locking conflicts.
 * Note: many database have limited precision of timestamps which can be an issue is highly concurrent systems.
 *
 * The parameter 'shouldStoreInCache' configures the version lock value to be stored in the cache or in the object.
 * Note: if using a stateless model where the object can be passed to a client and then later updated in a different transaction context,
 * then the version lock value should not be stored in the cache, but in the object to ensure it is the correct value for that object.
 * @see VersionLockingPolicy
 */
public void useTimestampLocking(String writeLockFieldName, boolean shouldStoreInCache) {
  TimestampLockingPolicy policy = new TimestampLockingPolicy(writeLockFieldName);
  if (shouldStoreInCache) {
    policy.storeInCache();
  } else {
    policy.storeInObject();
  }
  setOptimisticLockingPolicy(policy);
}
org.eclipse.persistence.descriptorsTimestampLockingPolicystoreInCache

Popular methods of TimestampLockingPolicy

  • <init>
    INTERNAL: Create a new TimestampLockingPolicy. Defaults to using the time retrieved from the server.
  • getDescriptor
  • getInitialWriteValue
    INTERNAL: returns the initial locking value
  • getWriteLockField
  • isNewerVersion
    INTERNAL: Compares the value from the row and from the object (or cache). Will return true if the ro
  • isStoredInCache
  • lockValueFromObject
  • storeInObject
  • useLocalTime
    PUBLIC: set this policy to get the time from the local machine.
  • useServerTime
    PUBLIC: set this policy to get the time from the server.
  • usesLocalTime
    PUBLIC: Return true if policy uses local time.
  • usesServerTime
    PUBLIC: Return true if policy uses server time.
  • usesLocalTime,
  • usesServerTime

Popular in Java

  • Reading from database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • onCreateOptionsMenu (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • JTable (javax.swing)
  • Top plugins for Android Studio
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