public JtaEntityManager(final String unitName, final JtaEntityManagerRegistry registry, final EntityManagerFactory entityManagerFactory, final Map properties, final boolean extended, final String synchronizationType) { if (registry == null) { throw new NullPointerException("registry is null"); } if (entityManagerFactory == null) { throw new NullPointerException("entityManagerFactory is null"); } this.unitName = unitName; this.registry = registry; this.entityManagerFactory = entityManagerFactory; this.properties = properties; this.extended = extended; this.synchronizationType = !isJPA21(entityManagerFactory) || synchronizationType == null ? null : SynchronizationType.valueOf(synchronizationType.toUpperCase(Locale.ENGLISH)); final String globalTimerConfig = SystemInstance.get().getProperty("openejb.jpa.timer"); final Object localTimerConfig = properties == null ? null : properties.get("openejb.jpa.timer"); this.timer = localTimerConfig == null ? (globalTimerConfig == null || Boolean.parseBoolean(globalTimerConfig)) : Boolean.parseBoolean(localTimerConfig.toString()); logger = unitName == null ? baseLogger : baseLogger.getChildLogger(unitName); final String wrapConfig = ReloadableEntityManagerFactory.class.isInstance(entityManagerFactory) ? ReloadableEntityManagerFactory.class.cast(entityManagerFactory).getUnitProperties().getProperty("openejb.jpa.query.wrap-no-tx", "true") : "true"; this.wrapNoTxQueries = wrapConfig == null || "true".equalsIgnoreCase(wrapConfig); }
new BeanContext.EntityManagerConfiguration( info.properties, JtaEntityManager.isJPA21(emf) && info.synchronizationType != null ? SynchronizationType.valueOf(info.synchronizationType) : null)); } catch (final NamingException e) { throw new OpenEJBException("PersistenceUnit '" + info.unitId + "' not found for EXTENDED ref '" + info.referenceName + "'");