Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-1155

BrokerImpl.detachAllInternal() does not detach newly loaded entities

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0-M3
    • kernel
    • None
    • Patch Available

    Description

      During detach, it is possible for additional entities to be loaded if the openjpa.DetachState property has been set to "all" or "fetch-groups". These entities may not be included in the collection of entities that are identified in the BrokerImpl.detachAllInternal() method when it calls the DetachManager.detachAll(collection) method. Before 2.0, these newly loaded entities were always detached since the detach processing always cascaded. However, with the 2.0 spec requirements for cascade, the default behavior no longer cascades. Therefore, there may be some entities left in the persistence context after this processing occurs. detachAllInternal() is associated with the clear(), close(), and afterCompletion() operations and it is expected that the persistence context really be empty. To ensure this, the compatibility option of cascadeWithDetach will be set to true by detachAllInternal() before calling the DetachManager.detach() method.

      Attachments

        1. patch.txt
          0.9 kB
          Dianne E. Richards
        2. patch2.txt
          1 kB
          Dianne E. Richards

        Activity

          People

            dianner Dianne E. Richards
            dianner Dianne E. Richards
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: