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