Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-2899

entities returned from Queries that are created from transaction scoped entity manager used without jta, should be detached.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.1.0.Final
    • 7.1.0.Beta1
    • JPA / Hibernate
    • None

    Description

      JPA 2.0 section 3.8.6 Query Execution:

      "
      Query and TypedQuery methods other than the executeUpdate method are not required to be invoked within a transaction context, unless a lock mode other than LockModeType.NONE has been specified for the query. In particular, the getResultList and getSingleResult methods are not required to be invoked within a transaction context unless such a lock mode has been specified for the query.[47] If an entity manager with transaction-scoped persistence context is in use, the resulting entities will be detached; if an entity manager with an extended persistence context is used, they will be managed. See Chapter 7 for further discussion of entity manager use outside a transaction and persistence context types.
      "

      AS7-2781 has a test case that demonstrates that this doesn't happen (the Query is currently commented out).

      Attachments

        Issue Links

          Activity

            People

              smarlow1@redhat.com Scott Marlow
              smarlow1@redhat.com Scott Marlow
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: