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

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

Best Java code snippets using org.eclipse.persistence.descriptors.TimestampLockingPolicy.storeInObject (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.descriptorsTimestampLockingPolicystoreInObject

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
  • storeInCache
  • 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

  • Updating database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • addToBackStack (FragmentTransaction)
  • getContentResolver (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • BoxLayout (javax.swing)
  • JTextField (javax.swing)
  • Top Sublime Text 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