jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceProviderTracker.java
private void createAndCloseDummyEMF(PersistenceProvider provider) {
        DataSource dummyDataSource = new DummyDataSource();
        punit.setJtaDataSource(dummyDataSource);
        punit.setNonJtaDataSource(dummyDataSource);
        try {
            EntityManagerFactory emf = provider.createContainerEntityManagerFactory(punit, null);
            emf.close();
        } catch (Exception e) {
            LOGGER.debug("Error while creating the Dummy EntityManagerFactory to allow weaving.", e);
        }
        punit.setJtaDataSource(null);
        punit.setNonJtaDataSource(null);
    }
/**
     * Create and close a dummy EMF to give the PersistenceProvider a chance to call
     * punit.addTransformer(). This has to occur as early as possible as weaving needs
     * to be done before the first entity class is loaded. So we can not wait till the
     * real DataSource is found.
     */
Create and close a dummy EMF to give the PersistenceProvider a chance to call
punit.addTransformer(). This has to occur as early as possible as weaving needs
to be done before the first entity class is loaded. So we can not wait till the
real DataSource is found.
Create and close a dummy EMF to give the PersistenceProvider a chance to call punit . addTransformer () . This has to occur as early as possible as weaving needs to be done before the first entity class is loaded . So we can not wait till the real DataSource is found .
private void createAndCloseDummyEMF(PersistenceProvider provider) {
        DataSource dummyDataSource = new DummyDataSource();
        punit.setJtaDataSource(dummyDataSource);
        punit.setNonJtaDataSource(dummyDataSource);
        try {
            EntityManagerFactory emf = provider.createContainerEntityManagerFactory(punit, null);
            emf.close();
        } catch (Exception e) {
            LOGGER.debug("Error while creating the Dummy EntityManagerFactory to allow weaving.", e);
        }
        punit.setJtaDataSource(null);
        punit.setNonJtaDataSource(null);
    }
private void createAndCloseDummyEMF ( PersistenceProvider provider ) { DataSource dummyDataSource = new DummyDataSource ( ) ; punit . setJtaDataSource ( dummyDataSource ) ; punit . setNonJtaDataSource ( dummyDataSource ) ; try { EntityManagerFactory emf = provider . createContainerEntityManagerFactory ( punit , null ) ; emf . close ( ) ; } catch ( Exception e ) { LOGGER . debug ( "Error while creating the Dummy EntityManagerFactory to allow weaving." , e ) ; } punit . setJtaDataSource ( null ) ; punit . setNonJtaDataSource ( null ) ; }
Create and close a dummy EMF to give the PersistenceProvider a chance to call
 punit.addTransformer().
Create and close a dummy EMF to give the PersistenceProvider a chance to call punit . addTransformer () .