mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #810] [CLOSED] New versioning strategy for optimistic lock: next version value managed by App #8737
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?
📋 Pull Request Information
Original PR: https://github.com/doctrine/orm/pull/810
Author: @diego-mazzaro
Created: 10/1/2013
Status: ❌ Closed
Base:
master← Head:AppManagedVersions📝 Commits (1)
e465001Added versioning strategy for optimistic lock with next version value managed at the app level📊 Changes
6 files changed (+131 additions, -45 deletions)
View changed files
📝
lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php(+2 -0)📝
lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php(+59 -8)📝
lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php(+3 -0)📝
lib/Doctrine/ORM/Persisters/BasicEntityPersister.php(+59 -31)📝
lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php(+6 -4)📝
lib/Doctrine/ORM/UnitOfWork.php(+2 -2)📄 Description
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:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.