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

Issue info / warning message when connection retain mode is always

    Details

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

      Description

      Many users see better performance when setting openjpa.ConnectionRetainMode to always. But they might not be aware of the consequences - the EntityManager must be closed in order to release the connection.

      In the case of application managed entity managers, the application should always close the EntityManager when it's done. But since this may or may not be obvious, it's a good idea to log an info message.

      In the case where the application cannot directly close the EntityManager (e.g. a Container Managed EntityManager), we should log a warning to let users know that each EntityManager may hold on to a connection for a long time.

      Unfortunately we can only detect whether the EMF is container managed, not the EM - but some warning is better than none.

        Activity

        Hide
        mikedd Michael Dick added a comment -

        The change has been committed to trunk under revision 1045397. My typo in the commit message prevents it from linking here.

        Show
        mikedd Michael Dick added a comment - The change has been committed to trunk under revision 1045397. My typo in the commit message prevents it from linking here.

          People

          • Assignee:
            mikedd Michael Dick
            Reporter:
            mikedd Michael Dick
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development