public PersistenceContext getCommandScopedPersistenceContext() { return new JpaPersistenceContext( (EntityManager) this.env.get( EnvironmentName.CMD_SCOPED_ENTITY_MANAGER ), isJTA ); }
public PersistenceContext getApplicationScopedPersistenceContext() { return new JpaPersistenceContext( getApplicationScopedEntityManager(), txm ); }
public PersistenceContext getCommandScopedPersistenceContext() { return new JpaPersistenceContext( getCommandScopedEntityManager(), txm ); }
public PersistenceContext getCommandScopedPersistenceContext() { return new JpaPersistenceContext( (EntityManager) this.env.get( EnvironmentName.CMD_SCOPED_ENTITY_MANAGER ), isJTA ); }
public PersistenceContext getCommandScopedPersistenceContext() { return new JpaPersistenceContext( (EntityManager) this.env.get( EnvironmentName.CMD_SCOPED_ENTITY_MANAGER ), isJTA ); }
public PersistenceContext getApplicationScopedPersistenceContext() { return new JpaPersistenceContext( getApplicationScopedEntityManager(), isJTA, pessimisticLocking, (String) this.env.get(EnvironmentName.USE_PESSIMISTIC_LOCKING_MODE), (TransactionManager) this.env.get(EnvironmentName.TRANSACTION_MANAGER)); }
public PersistenceContext getCommandScopedPersistenceContext() { return new JpaPersistenceContext( (EntityManager) this.env.get(EnvironmentName.CMD_SCOPED_ENTITY_MANAGER), isJTA, pessimisticLocking, (String) this.env.get(EnvironmentName.USE_PESSIMISTIC_LOCKING_MODE), (TransactionManager) this.env.get(EnvironmentName.TRANSACTION_MANAGER)); }
public PersistenceContext getApplicationScopedPersistenceContext() { return new JpaPersistenceContext( getApplicationScopedEntityManager(), isJTA, pessimisticLocking, (String) this.env.get(EnvironmentName.USE_PESSIMISTIC_LOCKING_MODE), (TransactionManager) this.env.get(EnvironmentName.TRANSACTION_MANAGER)); }
public PersistenceContext getCommandScopedPersistenceContext() { return new JpaPersistenceContext( (EntityManager) this.env.get(EnvironmentName.CMD_SCOPED_ENTITY_MANAGER), isJTA, pessimisticLocking, (String) this.env.get(EnvironmentName.USE_PESSIMISTIC_LOCKING_MODE), (TransactionManager) this.env.get(EnvironmentName.TRANSACTION_MANAGER)); }
public PersistenceContext getApplicationScopedPersistenceContext() { if ( this.appScopedEntityManager == null ) { // Use the App scoped EntityManager if the user has provided it, and it is open. this.appScopedEntityManager = (EntityManager) this.env.get( EnvironmentName.APP_SCOPED_ENTITY_MANAGER ); if ( this.appScopedEntityManager != null && !this.appScopedEntityManager.isOpen() ) { throw new RuntimeException( "Provided APP_SCOPED_ENTITY_MANAGER is not open" ); } if ( this.appScopedEntityManager == null ) { EntityManagerHolder emHolder = (EntityManagerHolder) TransactionSynchronizationManager.getResource( this.emf ); if ( emHolder == null ) { this.appScopedEntityManager = this.emf.createEntityManager(); emHolder = new EntityManagerHolder( this.appScopedEntityManager ); TransactionSynchronizationManager.bindResource( this.emf, emHolder ); internalAppScopedEntityManager = true; } else { this.appScopedEntityManager = emHolder.getEntityManager(); } this.env.set( EnvironmentName.APP_SCOPED_ENTITY_MANAGER, emHolder.getEntityManager() ); } } if ( TransactionSynchronizationManager.isActualTransactionActive() && isJTA) { this.appScopedEntityManager.joinTransaction(); } return new JpaPersistenceContext( this.appScopedEntityManager, isJTA ); }
public PersistenceContext getApplicationScopedPersistenceContext() { if ( this.appScopedEntityManager == null ) { // Use the App scoped EntityManager if the user has provided it, and it is open. this.appScopedEntityManager = (EntityManager) this.env.get( EnvironmentName.APP_SCOPED_ENTITY_MANAGER ); if ( this.appScopedEntityManager != null && !this.appScopedEntityManager.isOpen() ) { throw new RuntimeException( "Provided APP_SCOPED_ENTITY_MANAGER is not open" ); } if ( this.appScopedEntityManager == null ) { EntityManagerHolder emHolder = (EntityManagerHolder) TransactionSynchronizationManager.getResource( this.emf ); if ( emHolder == null ) { this.appScopedEntityManager = this.emf.createEntityManager(); emHolder = new EntityManagerHolder( this.appScopedEntityManager ); TransactionSynchronizationManager.bindResource( this.emf, emHolder ); internalAppScopedEntityManager = true; } else { this.appScopedEntityManager = emHolder.getEntityManager(); } this.env.set( EnvironmentName.APP_SCOPED_ENTITY_MANAGER, emHolder.getEntityManager() ); } } if ( TransactionSynchronizationManager.isActualTransactionActive() && isJTA) { this.appScopedEntityManager.joinTransaction(); } return new JpaPersistenceContext( this.appScopedEntityManager, isJTA ); }
public PersistenceContext getApplicationScopedPersistenceContext() { if ( this.appScopedEntityManager == null ) { // Use the App scoped EntityManager if the user has provided it, and it is open. this.appScopedEntityManager = (EntityManager) this.env.get( EnvironmentName.APP_SCOPED_ENTITY_MANAGER ); if ( this.appScopedEntityManager != null && !this.appScopedEntityManager.isOpen() ) { throw new RuntimeException( "Provided APP_SCOPED_ENTITY_MANAGER is not open" ); } if ( this.appScopedEntityManager == null ) { EntityManagerHolder emHolder = (EntityManagerHolder) TransactionSynchronizationManager.getResource( this.emf ); if ( emHolder == null ) { this.appScopedEntityManager = this.emf.createEntityManager(); emHolder = new EntityManagerHolder( this.appScopedEntityManager ); TransactionSynchronizationManager.bindResource( this.emf, emHolder ); internalAppScopedEntityManager = true; } else { this.appScopedEntityManager = emHolder.getEntityManager(); } this.env.set( EnvironmentName.APP_SCOPED_ENTITY_MANAGER, emHolder.getEntityManager() ); } } if ( TransactionSynchronizationManager.isActualTransactionActive() && isJTA) { this.appScopedEntityManager.joinTransaction(); } return new JpaPersistenceContext( this.appScopedEntityManager, isJTA ); }