[DDC-683] EntityManager#lock() on unitialized proxy coudl be optimized Created: 10/Jul/10 Updated: 21/Jul/10 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.0-BETA2 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
If you call lock() on an unitiialized proxy, it would be possible to combine the fetch and lock in one operation. Is this feasible from a technical / workflow perspsective? |
| Comments |
| Comment by Benjamin Eberlei [ 21/Jul/10 ] |
|
Ok this is what refresh() with LOCK support is actually needed for: public function lock($entity, $lockMode, $lockVersion = null) { if ($this->getEntityState($entity) != self::STATE_MANAGED) { throw new InvalidArgumentException("Entity is not MANAGED."); } else if ($entity instanceof Proxy && $entity->__isInitialized__) { $this->refresh(....); // with LOCK! } ... } |