Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-683

EntityManager#lock() on unitialized proxy coudl be optimized

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0-BETA2
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      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?

        Issue Links

          Activity

          Benjamin Eberlei created issue -
          Benjamin Eberlei made changes -
          Field Original Value New Value
          Component/s ORM [ 10012 ]
          Benjamin Eberlei made changes -
          Link This issue relates to DDC-681 [ DDC-681 ]
          Hide
          Benjamin Eberlei added a comment -

          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!
                  }
                  ...
              }
          
          Show
          Benjamin Eberlei added a comment - 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! } ... }
          Benjamin Eberlei made changes -
          Workflow jira [ 11611 ] jira-feedback [ 13861 ]
          Benjamin Eberlei made changes -
          Workflow jira-feedback [ 13861 ] jira-feedback2 [ 15725 ]
          Benjamin Eberlei made changes -
          Workflow jira-feedback2 [ 15725 ] jira-feedback3 [ 17982 ]

          This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

          • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-683, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

            People

            • Assignee:
              Benjamin Eberlei
              Reporter:
              Benjamin Eberlei
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: