mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-2719: [GH-810] New versioning strategy for optimistic lock: next version value managed by App #3402
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?
Originally created by @doctrinebot on GitHub (Oct 1, 2013).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user @doctrinebot:
This issue is created automatically through a Github pull request on behalf of diego-mazzaro:
Url: https://github.com/doctrine/doctrine2/pull/810
Message:
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:
@doctrinebot commented on GitHub (Oct 3, 2013):
Comment created by diego.mazzaro:
I forgot to give an example of how configuration files has to be written to let this additional versioning mode works.
Here is following with an yml mapping file:
pratically all remains as usual but if under the "version" label a sub label "nextVersionProperty" is found then the class property with that name will be added to the
reflFieldsso that its value can be used when preparing the INSERT and UPDATE of theversionField.@doctrinebot commented on GitHub (Jan 2, 2014):
Comment created by @doctrinebot:
A related Github Pull-Request [GH-810] was closed:
https://github.com/doctrine/doctrine2/pull/810
@doctrinebot commented on GitHub (Jan 2, 2014):
Issue was closed with resolution "Won't Fix"