Package br.gov.frameworkdemoiselle.transaction

Examples of br.gov.frameworkdemoiselle.transaction.Transaction.commit()


          transactionInfo.clear();

          getLogger().info(getBundle().getString("transaction-rolledback"));

        } else {
          transaction.commit();
          transactionInfo.clear();

          getLogger().info(getBundle().getString("transaction-commited"));
        }
      }
View Full Code Here


          transactionInfo.clear();

          getLogger().info(getBundle().getString("transaction-rolledback"));

        } else {
          transaction.commit();
          transactionInfo.clear();

          getLogger().info(getBundle().getString("transaction-commited"));
        }
      }
View Full Code Here

    em2.joinTransaction();

    em1.persist(entity1);
    em2.persist(entity2);
   
    transaction.commit();
    em1.clear();
    em2.clear();

    MyEntity1 persisted1 = em1.find(MyEntity1.class, createId("id-1"));
    MyEntity2 persisted2 = em2.find(MyEntity2.class, createId("id-2"));
View Full Code Here

   
    em1.joinTransaction();

    em1.persist(entity1);
   
    transaction.commit();
    em1.clear();

    entity1 = new MyEntity1();
    entity1.setId(createId("id-1"));
    entity1.setDescription("desc-1");
View Full Code Here

   
    em1.joinTransaction();
    em1.persist(entity1);
   
    try {
      transaction.commit();
      Assert.fail();
    }
    catch(TransactionException e) {
      e.printStackTrace();
      //success
View Full Code Here

    transaction.begin();
    assertTrue(transaction.isActive());

    em1.persist(entity1);
    em2.persist(entity2);
    transaction.commit();
    em1.clear();
    em2.clear();

    MyEntity1 persisted1 = em1.find(MyEntity1.class, createId("id-1"));
    MyEntity2 persisted2 = em2.find(MyEntity2.class, createId("id-2"));
View Full Code Here

    assertFalse(transaction.isActive());
    transaction.begin();
    assertTrue(transaction.isActive());

    em1.persist(entity1);
    transaction.commit();
    em1.clear();

    entity1 = new MyEntity1();
    entity1.setId(createId("id-7"));
    entity1.setDescription("desc-7");
View Full Code Here

    assertTrue(transaction.isActive());
   
    em1.persist(entity1);
   
    try {
      transaction.commit();
      Assert.fail();
    }
    catch(TransactionException te) {
      te.printStackTrace();
      //success
View Full Code Here

    EntityManager em1 = Beans.getReference(EntityManager.class, new NameQualifier("pu3"));

    try {
      em1.persist(entity1);
      transaction.commit();

    } catch (TransactionRequiredException te) {
      fail("Entity Manager não ingressou em transação já em curso: " + te.getMessage());
    }
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.