If you manage your own JPA objects, then try-with-resources is a good thing that has to do with EntityManager and, to a lesser extent, EntityManagerFactory.
, EntityManagerFactory java.lang.reflect.Proxy, AutoCloseable . createEntityManager(), EntityManager, AutoCloseable.
, JPA, , webapp, .