Examples of joinTransaction()


Examples of javax.persistence.EntityManager.joinTransaction()

                          this.cmdScopedEntityManager );
            cmdScopedEntityManager = this.cmdScopedEntityManager;
        } else {
            internalCmdScopedEntityManager = false;
        }
        cmdScopedEntityManager.joinTransaction();
        appScopedEntityManager.joinTransaction();
    }

    public void endCommandScopedEntityManager() {
        if ( this.internalCmdScopedEntityManager ) {
View Full Code Here

Examples of javax.persistence.EntityManager.joinTransaction()

         catch (SystemException e)
         {
            throw new RuntimeException(e)//To change body of catch statement use Options | File Templates.
         }
         session.set(rtnSession);
         rtnSession.joinTransaction(); // force registration with TX
      }
      return rtnSession;
   }

   public EntityManager createEntityManager()
View Full Code Here

Examples of javax.persistence.EntityManager.joinTransaction()

                          this.cmdScopedEntityManager );
            cmdScopedEntityManager = this.cmdScopedEntityManager;
        } else {
            internalCmdScopedEntityManager = false;
        }
        cmdScopedEntityManager.joinTransaction();
        appScopedEntityManager.joinTransaction();
    }

    public void endCommandScopedEntityManager() {
        if ( this.internalCmdScopedEntityManager ) {
View Full Code Here

Examples of javax.persistence.EntityManager.joinTransaction()

        // Initialized persistence/tx's and persist to db
        EntityManager em = emf.createEntityManager();
        em.setFlushMode(FlushModeType.COMMIT);
        UserTransaction tx = findUserTransaction();
        tx.begin();
        em.joinTransaction();
        em.persist(badMainObject);
       
        boolean rollBackExceptionthrown = false;
        try {
            logger.info("The following " + IllegalStateException.class.getSimpleName() + " SHOULD be thrown.");
View Full Code Here

Examples of javax.persistence.EntityManager.joinTransaction()

        mainObject.setName("main" + testName);
        mainObject.setSubObject(subObject);
       
        // Now persist both..
        tx.begin();
        em.joinTransaction();
        em.persist(mainObject);
        em.persist(subObject);
       
        try {
            tx.commit();
View Full Code Here

Examples of javax.persistence.EntityManager.joinTransaction()

                throw new IllegalStateException("InternalError: an entity manager should already be registered for this extended persistence unit");
            }

            // if transaction is active, we need to register the entity manager with the transaction manager
            if (transactionActive) {
                entityManager.joinTransaction();
                transactionRegistry.putResource(txKey, entityManager);
            }

            return entityManager;
        } else {
View Full Code Here

Examples of javax.persistence.EntityManager.joinTransaction()

            }

            for (Map.Entry<EntityManagerFactory, EntityManager> entry : entityManagers.entrySet()) {
                EntityManagerFactory entityManagerFactory = entry.getKey();
                EntityManager entityManager = entry.getValue();
                entityManager.joinTransaction();
                EntityManagerTxKey txKey = new EntityManagerTxKey(entityManagerFactory);
                transactionRegistry.putResource(txKey, entityManager);
            }
        }
    }
View Full Code Here

Examples of javax.persistence.EntityManager.joinTransaction()

            if (log.isDebugEnabled())
                log.debug(getEntityManagerDetails(entityManager) + ": created entity manager session " +
                    getTransaction().toString());
            registerSynchronization(entityManager, scopedPuName, true);
            putEntityManagerInTransactionRegistry(scopedPuName, entityManager);
            entityManager.joinTransaction(); // force registration with TX
        } else {
            if (log.isDebugEnabled()) {
                log.debug(getEntityManagerDetails(entityManager) + ": reuse entity manager session already in tx" +
                    getTransaction().toString());
            }
View Full Code Here

Examples of javax.persistence.EntityManager.joinTransaction()

            }
            EntityManager entityManager = entityManagerTracker.getEntityManager();

            // if transaction is active, we need to register the entity manager with the transaction manager
            if (transactionActive) {
                entityManager.joinTransaction();
                transactionRegistry.putResource(txKey, entityManager);
            }

            return entityManager;
        } else {
View Full Code Here

Examples of javax.persistence.EntityManager.joinTransaction()

            }

            for (Map.Entry<EntityManagerFactory, EntityManagerTracker> entry : entityManagers.entrySet()) {
                EntityManagerFactory entityManagerFactory = entry.getKey();
                EntityManager entityManager = entry.getValue().getEntityManager();
                entityManager.joinTransaction();
                EntityManagerTxKey txKey = new EntityManagerTxKey(entityManagerFactory);
                transactionRegistry.putResource(txKey, entityManager);
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.