OpenJPA
  1. OpenJPA
  2. OPENJPA-1807

Improved lifecycle tracing of EntityManager and EntityManagerFactory

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.1.0
    • Component/s: logging
    • Labels:
      None

      Description

      I had to debug a problem today that would have been very simple to solve with the proper OpenJPA tracing. With this JIRA I am going to add trace to EM/EMF creation/close. I'm adding trace (not info/warn messages) so these messages will not be localized.

        Activity

        Hide
        Rick Curtis added a comment -

        The trace I'm going to commit shortly adds the following :

        172 test TRACE [main] openjpa.Runtime - org.apache.openjpa.persistence.PersistenceProviderImpl@3a523a52 creating org.apache.openjpa.persistence.EntityManagerFactoryImpl@1bd11bd1 for PU test
        ...
        2312 test TRACE [main] openjpa.Runtime - org.apache.openjpa.persistence.EntityManagerFactoryImpl@1bd11bd1 created EntityManager org.apache.openjpa.persistence.EntityManagerImpl@4e164e16
        ...
        2562 test TRACE [main] openjpa.Runtime - org.apache.openjpa.persistence.EntityManagerImpl@4e164e16.close() invoked.
        ....
        2578 test TRACE [main] openjpa.Runtime - org.apache.openjpa.persistence.EntityManagerFactoryImpl@1bd11bd1 created EntityManager org.apache.openjpa.persistence.EntityManagerImpl@2f2c2f2c
        ...
        2922 test TRACE [main] openjpa.Runtime - org.apache.openjpa.persistence.EntityManagerImpl@2f2c2f2c.close() invoked.
        ....
        2922 test TRACE [main] openjpa.Runtime - org.apache.openjpa.persistence.EntityManagerFactoryImpl@1bd11bd1.close() invoked.

        Show
        Rick Curtis added a comment - The trace I'm going to commit shortly adds the following : 172 test TRACE [main] openjpa.Runtime - org.apache.openjpa.persistence.PersistenceProviderImpl@3a523a52 creating org.apache.openjpa.persistence.EntityManagerFactoryImpl@1bd11bd1 for PU test ... 2312 test TRACE [main] openjpa.Runtime - org.apache.openjpa.persistence.EntityManagerFactoryImpl@1bd11bd1 created EntityManager org.apache.openjpa.persistence.EntityManagerImpl@4e164e16 ... 2562 test TRACE [main] openjpa.Runtime - org.apache.openjpa.persistence.EntityManagerImpl@4e164e16.close() invoked. .... 2578 test TRACE [main] openjpa.Runtime - org.apache.openjpa.persistence.EntityManagerFactoryImpl@1bd11bd1 created EntityManager org.apache.openjpa.persistence.EntityManagerImpl@2f2c2f2c ... 2922 test TRACE [main] openjpa.Runtime - org.apache.openjpa.persistence.EntityManagerImpl@2f2c2f2c.close() invoked. .... 2922 test TRACE [main] openjpa.Runtime - org.apache.openjpa.persistence.EntityManagerFactoryImpl@1bd11bd1.close() invoked.
        Hide
        Rick Curtis added a comment -

        We could do some more work this area... but this is a start.

        Committed 999077 to trunk.

        Show
        Rick Curtis added a comment - We could do some more work this area... but this is a start. Committed 999077 to trunk.

          People

          • Assignee:
            Rick Curtis
            Reporter:
            Rick Curtis
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development