Uploaded image for project: 'Hibernate Search'
  1. HSEARCH-2946

JSR-352: Simplify EntityManager closing in tests

    Details

    • Type: Task
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.9.0.Beta1
    • Component/s: jsr352
    • Labels:
      None

      Description

      AbstractBatchIndexingIT.java
      try {
          em = emf.createEntityManager();
          // ...
      }
      finally {
          try {
              em.close();
          }
          catch (Exception e) {
              log.error( e );
          }
      }
      

      The try-catch block is not really necessary in tests, neither the logger. The goal here is just to ensure the entity-manager is closed at the end.

        Attachments

          Activity

            People

            • Assignee:
              mincong Mincong Huang
              Reporter:
              mincong Mincong Huang
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: