Uploaded image for project: 'Doctrine 1'
  1. Doctrine 1
  2. DC-1047

hardDelete not resetting flag if exception is thrown


    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Behaviors
    • Labels:


      To be honest I don't know wich version I have but I believe it to be 1.2.3

      The problem is pretty simple, I was trying to do a hardDelete and if it fails I would do a softDelete.

      try {
      catch (Exception $e) {
          if ($e instanceof Doctrine_Connection_Mysql_Exception && $e->getPortableCode() == Doctrine_Core::ERR_CONSTRAINT) {
              try {
              catch (Exception $e1) {
                  throw $e1;
          else {
              throw $e;

      But when the first exception is thrown from hardDelete() in Doctrine_Template_SoftDelete(line 84) the listener flag for hardDelete is not set to false, so if I try to do the delete, it will still behave as if it was a hardDelete.

      The solution would be catch the exception, reset the flag and rethrow it.
      Patch attached

      Hope this info is enough.


        lonewolf4 Lone Wolf created issue -

        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={expand=changesets[0:20].revisions[0:29],reviews, query=DC-1047}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)


          • Assignee:
            jwage Jonathan H. Wage
            lonewolf4 Lone Wolf
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: