For each of the following version locking policies, you must add a specific database field.
TopLink records the version as it reads an object from a table. When the client attempts to write the object, TopLink compares the version of the object with the version in the table record.
The two version locking policies have different ways of writing to the database:
VersionLockingPolicy
, the number in the version field increments by one. TimestampLockingPolicy
, a new timestamp is inserted into the row (this policy can be configured to get the time from the server or locally).For both policies, the values of the write lock field can be the writable mapping within the object.
If the value is stored in the identity map, then by default an attribute mapping is not required for the version field. If the application does map the field, it must make the mappings read-only to allow TopLink to control writing the fields.
Copyright © 1997, 2004, Oracle. All rights reserved.