}
for (PersistenceUnitInfo unitInfo : appInfo.persistenceUnits) {
try {
Object object = globalContext.lookup(PERSISTENCE_UNIT_NAMING_CONTEXT + unitInfo.id);
globalContext.unbind(PERSISTENCE_UNIT_NAMING_CONTEXT + unitInfo.id);
// close EMF so all resources are released
ReloadableEntityManagerFactory remf = ((ReloadableEntityManagerFactory) object);
remf.close();
persistenceClassLoaderHandler.destroy(unitInfo.id);