Package br.gov.frameworkdemoiselle.transaction

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


  private void initiate(final InvocationContext ic) {
    Transaction transaction = getTransactionContext().getCurrentTransaction();
    TransactionInfo transactionInfo = getTransactionInfo();

    if (!transaction.isActive()) {
      transaction.begin();
      transactionInfo.markAsOwner();
      getLogger().info(getBundle().getString("begin-transaction"));
    }

    transactionInfo.incrementCounter();
View Full Code Here


  private void initiate(final InvocationContext ic) {
    Transaction transaction = getTransactionContext().getCurrentTransaction();
    TransactionInfo transactionInfo = getTransactionInfo();

    if (!transaction.isActive()) {
      transaction.begin();
      transactionInfo.markAsOwner();
      getLogger().info(getBundle().getString("begin-transaction"));
    }

    transactionInfo.incrementCounter();
View Full Code Here

    entity2.setId(createId("id-2"));
    entity2.setDescription("desc-2");

    assertFalse(transaction.isActive());
   
    transaction.begin();
    assertTrue(transaction.isActive());
   
    em1.joinTransaction();
    em2.joinTransaction();
View Full Code Here

    entity1.setId(createId("id-1"));
    entity1.setDescription("desc-1");

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

    em1.persist(entity1);
View Full Code Here

    entity1 = new MyEntity1();
    entity1.setId(createId("id-1"));
    entity1.setDescription("desc-1");
   
    assertFalse(transaction.isActive());
    transaction.begin();
    assertTrue(transaction.isActive());
   
    em1.joinTransaction();
    em1.persist(entity1);
   
View Full Code Here

    MyEntity2 entity2 = new MyEntity2();
    entity2.setId(createId("id-4"));

    assertFalse(transaction.isMarkedRollback());
    transaction.begin();
    assertTrue(transaction.isActive());
   
    em1.joinTransaction();
    em2.joinTransaction();
View Full Code Here

    MyEntity2 entity2 = new MyEntity2();
    entity2.setId(createId("id-2"));
    entity2.setDescription("desc-2");

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

    em1.persist(entity1);
    em2.persist(entity2);
    transaction.commit();
View Full Code Here

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

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

    em1.persist(entity1);
    transaction.commit();
    em1.clear();
View Full Code Here

    entity1 = new MyEntity1();
    entity1.setId(createId("id-7"));
    entity1.setDescription("desc-7");
   
    assertFalse(transaction.isActive());
    transaction.begin();
    assertTrue(transaction.isActive());
   
    em1.persist(entity1);
   
    try {
View Full Code Here

    MyEntity2 entity2 = new MyEntity2();
    entity2.setId(createId("id-4"));

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

    em1.persist(entity1);
    em2.persist(entity2);
    em1.flush();
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.