FriendsOfSymfony1 / doctrine1

[DEPRECATED -- Use Doctrine2 instead] Doctrine 1 Object Relational Mapper.
http://www.doctrine-project.org
GNU Lesser General Public License v2.1
40 stars 75 forks source link

Per record locking #46

Open mkopinsky opened 6 years ago

mkopinsky commented 6 years ago

The Doctrine_Locking_Manager_Pessimistic has a bug where instead of locking by the record's ID, it was locking by the string "id". Which obviously meant you couldn't lock two things at once.

In our use case we were more interested in tracking the request ID which created a lock rather than the user, which explains the change of language from user_ident to lock_key in the PR. The changed column name I guess is technically BC-breaking for people actively using this, so we might want to revert that. (EDIT: the BC break has been reverted) On the other hand, given how clearly broken this was, I'm not sure if there even can be people using this in prod.

The added unit test fails when run against the code before these changes.

mkopinsky commented 6 years ago

Hey @j0k3r any chance you could merge this?

j0k3r commented 6 years ago

I'm sure about merging that. @GromNaN what do you think?