unitMetaData = EntityManagerFactoryImpl.unitMetaDataCache.get(unitName);
if (unitMetaData == null)
{
// Find all "META-INF/persistence.xml" files in the current thread loader CLASSPATH and parse them
// Create a temporary PMFContext so we have a parser
OMFContext pmfCtxt = new OMFContext(new PersistenceConfiguration(){});
pmfCtxt.setApi("JPA");
MetaDataManager metadataMgr = pmfCtxt.getMetaDataManager();
PersistenceFileMetaData[] files = metadataMgr.parsePersistenceFiles();
if (files == null)
{
// No "persistence.xml" files found
JPOXLogger.JPA.warn(LOCALISER.msg("EMF.NoPersistenceXML"));