jpa-spec
  1. jpa-spec
  2. JPA_SPEC-37

Improve JPA compliance statement in 3.5.2 for injected resources

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      Copied from https://issues.jboss.org/browse/CDI-144

      JPA spec 3.5.2 states: "In general, the lifecycle method of a portable application should not invoke EntityManager or Query operations, access other entity instances, or modify relationships within the same persistence context.[45] A lifecycle callback method may modify the non-relationship state of the entity on which it is invoked."

      Since I have been running into this issue lately: Shouldn't we add a note somewhere that injected (CDI) resources require special attention regarding JPA compliance? And because of that firing CDI events from JPA entity listeners is particularly dangerous?

      In my case I tried to implement global available created/updated/deleted entity events which turned out to be a bad idea if implemented on EntityListener level.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            frenchc
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: