protected void onTxCompletion(boolean status) { if( txEntityManagerMap == null ) { return; } for (Map.Entry<EntityManagerFactory, SimpleResource> entry : getTxEntityManagerMap().entrySet()) { SimpleResource em = entry.getValue(); if (em.isOpen()) { try { em.close(); } catch (Throwable th) { if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Exception while closing em.", th); } } } } }