[DDC-2715] [GH-807] Fix for OptimisticLockingException Created: 01/Oct/13  Updated: 29/Oct/13  Resolved: 29/Oct/13

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3.5, 2.4.1
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of janbster:

Url: https://github.com/doctrine/doctrine2/pull/807

Message:

When using the $em->lock() method with an entity that uses a DateTime field for optimistic locking, and the optimistic locking fails, an OptimisticLockingException is generated Using the static method lockFailedVersionMismatch in OptimisticLockingException. In this case the parameters are of type DateTime. Therefore, the string for the exception message cannot be generated and you will get an error "Object of class DateTime could not be converted to string". I added a conversion to class to solve this problem.

I also changed the test OptimisticTest to actually test for this problem. If you run the tests without the changed OptimisticLockingException, you will see the error. I also modified the test to ensure that the Exception is actually thrown.



 Comments   
Comment by Doctrine Bot [ 01/Oct/13 ]

A related Github Pull-Request [GH-807] was closed:
https://github.com/doctrine/doctrine2/pull/807

Comment by Benjamin Eberlei [ 29/Oct/13 ]

Merged into 2.4 and 2.3 branches

Generated at Wed Oct 22 08:05:22 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.