Examples of joinTransaction()


Examples of javax.persistence.EntityManager.joinTransaction()

    assertFalse("Close should work on application managed EM", em.isOpen());
  }
 
  public void testEntityManagerProxyAcceptsProgrammaticTxJoining() {
    EntityManager em = entityManagerFactory.createEntityManager();
    em.joinTransaction();
  }
 
  public void testInstantiateAndSave() {
    EntityManager em = entityManagerFactory.createEntityManager();
    em.joinTransaction();
View Full Code Here

Examples of javax.persistence.EntityManager.joinTransaction()

    em.joinTransaction();
  }
 
  public void testInstantiateAndSave() {
    EntityManager em = entityManagerFactory.createEntityManager();
    em.joinTransaction();
    doInstantiateAndSave(em);
  }
 
  public void testCannotFlushWithoutGettingTransaction() {
    EntityManager em = entityManagerFactory.createEntityManager();   
View Full Code Here

Examples of javax.persistence.EntityManager.joinTransaction()

        0, countRowsInTable("person"));
  }
 
  public void testReuseInNewTransaction() {
    EntityManager em = entityManagerFactory.createEntityManager();
    em.joinTransaction();
   
    doInstantiateAndSave(em);
    endTransaction();
   
    assertFalse(em.getTransaction().isActive());
View Full Code Here

Examples of javax.persistence.EntityManager.joinTransaction()

    startNewTransaction();
    // Call any method: should cause automatic tx invocation
    assertFalse(em.contains(new Person()));
   
    assertFalse(em.getTransaction().isActive());
    em.joinTransaction();
   
    assertTrue(em.getTransaction().isActive());
   
    doInstantiateAndSave(em);
    setComplete();
View Full Code Here

Examples of javax.persistence.EntityManager.joinTransaction()

    assertEquals("Tx must have committed back",
        1, countRowsInTable("person"));
   
    // Now clean up the database
    startNewTransaction();
    em.joinTransaction();
    deleteAllPeopleUsingEntityManager(em);
    assertEquals("People have been killed",
        0, countRowsInTable("person"));
    setComplete();
  }
View Full Code Here

Examples of javax.persistence.EntityManager.joinTransaction()

    em.createQuery("delete from Person p").executeUpdate();
  }

  public void testRollbackOccurs() {
    EntityManager em = entityManagerFactory.createEntityManager();
    em.joinTransaction();
    doInstantiateAndSave(em);
    endTransaction()// Should rollback
    assertEquals("Tx must have been rolled back",
        0, countRowsInTable("person"));
  }
View Full Code Here

Examples of javax.persistence.EntityManager.joinTransaction()

        0, countRowsInTable("person"));
  }
 
  public void testCommitOccurs() {
    EntityManager em = entityManagerFactory.createEntityManager();
    em.joinTransaction();
    doInstantiateAndSave(em);
   
    setComplete();
    endTransaction()// Should rollback
    assertEquals("Tx must have committed back",
View Full Code Here

Examples of javax.persistence.EntityManager.joinTransaction()

    EntityManagerFactory emf = cefb.getObject();
    assertSame("EntityManagerFactory reference must be cached after init", emf, cefb.getObject());

    assertNotSame("EMF must be proxied", mockEmf, emf);
    EntityManager em = emf.createEntityManager();
    em.joinTransaction();
    assertFalse(em.contains(testEntity));

    jpatm.commit(txStatus);

    cefb.destroy();
View Full Code Here

Examples of javax.persistence.EntityManager.joinTransaction()

    EntityManagerFactory emf = cefb.getObject();
    assertSame("EntityManagerFactory reference must be cached after init", emf, cefb.getObject());

    assertNotSame("EMF must be proxied", mockEmf, emf);
    EntityManager em = emf.createEntityManager();
    em.joinTransaction();
    assertFalse(em.contains(testEntity));

    try {
      jpatm.commit(txStatus);
      fail("Should have thrown OptimisticLockingFailureException");
View Full Code Here

Examples of javax.persistence.EntityManager.joinTransaction()

    emfMc.setReturnValue(sharedEm);

    // This is the application-specific one
    MockControl emMc = MockControl.createControl(EntityManager.class);
    EntityManager mockEm = (EntityManager) emMc.getMock();
    mockEm.joinTransaction();
    emMc.setVoidCallable(1);
    mockEm.contains(testEntity);
    emMc.setReturnValue(false);
    emMc.replay();
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.