/** * PUBLIC: * Create a new VersionLockingPolicy. Defaults to * storing the lock value in the cache. */ public VersionLockingPolicy() { super(); storeInCache(); }
/** * PUBLIC: * Create a new VersionLockingPolicy. Defaults to * storing the lock value in the cache. */ public VersionLockingPolicy() { super(); storeInCache(); }
/** * PUBLIC: * Create a new VersionLockingPolicy. Defaults to * storing the lock value in the cache. */ public VersionLockingPolicy() { super(); storeInCache(); }
/** * PUBLIC: * Set whether to store the lock in the cache or in the object. * @param isStoredInCache set this to true if you would like to store lock in the cache and set it * to false if you would like to store it in the object. */ public void setIsStoredInCache(boolean isStoredInCache) { if (isStoredInCache) { storeInCache(); } else { storeInObject(); } }
/** * PUBLIC: * Set whether to store the lock in the cache or in the object. * @param isStoredInCache set this to true if you would like to store lock in the cache and set it * to false if you would like to store it in the object. */ public void setIsStoredInCache(boolean isStoredInCache) { if (isStoredInCache) { storeInCache(); } else { storeInObject(); } }
/** * PUBLIC: * Set whether to store the lock in the cache or in the object. * @param isStoredInCache set this to true if you would like to store lock in the cache and set it * to false if you would like to store it in the object. */ public void setIsStoredInCache(boolean isStoredInCache) { if (isStoredInCache) { storeInCache(); } else { storeInObject(); } }
/** * PUBLIC: * Set the locking policy to use numeric version locking. * This updates the version field on all updates, first comparing that the field has not changed to detect locking conflicts. * * 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 TimestampLockingPolicy */ public void useVersionLocking(String writeLockFieldName, boolean shouldStoreInCache) { VersionLockingPolicy policy = new VersionLockingPolicy(writeLockFieldName); if (shouldStoreInCache) { policy.storeInCache(); } else { policy.storeInObject(); } setOptimisticLockingPolicy(policy); }
/** * PUBLIC: * Set the locking policy to use numeric version locking. * This updates the version field on all updates, first comparing that the field has not changed to detect locking conflicts. * * 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 TimestampLockingPolicy */ public void useVersionLocking(String writeLockFieldName, boolean shouldStoreInCache) { VersionLockingPolicy policy = new VersionLockingPolicy(writeLockFieldName); if (shouldStoreInCache) { policy.storeInCache(); } else { policy.storeInObject(); } setOptimisticLockingPolicy(policy); }
/** * PUBLIC: * Set the locking policy to use numeric version locking. * This updates the version field on all updates, first comparing that the field has not changed to detect locking conflicts. * * 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 TimestampLockingPolicy */ public void useVersionLocking(String writeLockFieldName, boolean shouldStoreInCache) { VersionLockingPolicy policy = new VersionLockingPolicy(writeLockFieldName); if (shouldStoreInCache) { policy.storeInCache(); } else { policy.storeInObject(); } setOptimisticLockingPolicy(policy); }