* @return EntityManagerFactory
*/
private EntityManagerFactoryBuilder createContainerEntityManagerFactoryBuilder() {
persistenceProviderAdaptor.beforeCreateContainerEntityManagerFactory(pu);
try {
TwoPhaseBootstrapCapable twoPhaseBootstrapCapable = (TwoPhaseBootstrapCapable)persistenceProviderAdaptor;
return twoPhaseBootstrapCapable.getBootstrap(pu, properties.getValue());
} finally {
try {
persistenceProviderAdaptor.afterCreateContainerEntityManagerFactory(pu);
} finally {
pu.setAnnotationIndex(null); // close reference to Annotation Index (only needed during call to createContainerEntityManagerFactory)