private static void onDestroyDBResources ( EntityManagerFactory emf , EntityManager em ) { if ( emf != null ) { emf . close ( ) ; } if ( em != null ) { em . close ( ) ; } }
After successful processing close entity manager and it s factory instance .