mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[PR #810] New versioning strategy for optimistic lock: next version value managed by App #8740
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/doctrine/orm/pull/810
State: closed
Merged: No
With this improvment the next value for the version field used for the optimisic lock strategy can be managed by the application.
When can be useful?
Obviously it is useful if we whant different values than the standard and for example:
And really can be done something different from standard ways?
The base property that a version column next value must have in order to accomplish his own task is this:
be different from any value that any other concurrently running client/process/thread/session may have read as current version value for the same record.
The opposite may sound more clear: if I write the same value that anyone concurrently working with me has read as current version he will find the same version when writing and will think that all is ok.
That told the standard implementations are:
This two obviously respects the base property but the point is that they are not the only ones. Some examples: