[odb-users] ODB version as timestamp

Boris Kolpackov boris at codesynthesis.com
Wed Mar 27 09:29:06 EDT 2019


Paul Stath <PStath at jmawireless.com> writes:

> Is it possible in ODB to define the version attribute as a date-time stamp?
>
> [...]
>
> I would expect it to set obj.version to the current date/time when the
> record is persisted.

No, this is not supported. Quoting from Chapter 12, "Optimistic 
Concurrency":

"Currently, ODB uses object versioning while other methods, such as
timestamps, may be supported in the future.

[...]

The version data member is managed by ODB. It is initialized to 1 when the
object is made persistent and incremented by 1 with each update. The 0 version
value is not used by ODB and the application can use it as a special value,
for example, to indicate that the object is transient. [...]"



More information about the odb-users mailing list