Package javax.transaction

Examples of javax.transaction.Transaction.commit()


      assert "v".equals(cache.get(ABC, "k"));
      assert "v".equals(cache.get(AB, "k"));

      tm.resume(t1);
      t1.commit();

      assert "v2".equals(cache.get(AB, "k"));
      assert "v".equals(cache.get(ABC, "k"));
   }
View Full Code Here


      assert null == cache.get(ABC, "k");
      assert null == cache.get(AB, "k");

      tm.resume(t1);
      t1.commit();

      assert null == cache.get(ABC, "k");
      assert null == cache.get(AB, "k");
   }
View Full Code Here

      assert "v".equals(cache.get(AB, "k"));
      assert "v".equals(cache.get(ABC, "k"));

      tm.resume(t1);
      t1.commit();

      assert null == cache.get(ABC, "k");
      assert null == cache.get(AB, "k");
   }
}
View Full Code Here

      Transaction tx = tm.suspend();
      cache.put("/a", "k", "v2");
      assert cache.get("/a", "k").equals("v2");
      tm.resume(tx);
      cache.removeNode("/a");
      tx.commit();
      assert cache.getNode("/a") == null; // this fails
   }

   public void testRemoveAndOperateOnUnexistingNode() throws Exception
   {
View Full Code Here

                 currentTransaction.toString());
            logger.log(logMessage, LOG_CHANNEL, Logger.DEBUG);
        }

        try {
            currentTransaction.commit();
        } finally {
            bindings.remove(currentThread);
        }

    }
View Full Code Here

                 currentTransaction.toString());
            logger.log(logMessage, LOG_CHANNEL, Logger.DEBUG);
        }

        try {
            currentTransaction.commit();
        } finally {
            bindings.remove(currentThread);
        }

    }
View Full Code Here

        Transaction tx = getTransaction();
        if (tx == null) {
            throw new IllegalStateException("No transaction associated with current thread");
        }
        try {
            tx.commit();
        } finally {
            unassociate();
        }
    }
View Full Code Here

        assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
        tm.begin();
        assertEquals(Status.STATUS_ACTIVE, tm.getStatus());
        Transaction tx = tm.getTransaction();
        assertNotNull(tx);
        tx.commit();
        assertNotNull(tm.getTransaction());
        assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
    }

    public void testNoResourcesMarkRollbackOnly() throws Exception {
View Full Code Here

        Transaction tx = tm.getTransaction();
        assertNotNull(tx);
        tx.setRollbackOnly();
        assertEquals(Status.STATUS_MARKED_ROLLBACK, tx.getStatus());
        try {
            tx.commit();
            fail("tx should not commit");
        } catch (RollbackException e) {
            //expected
        }
        assertNotNull(tm.getTransaction());
View Full Code Here

        assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
        tm.begin();
        Transaction tx = tm.getTransaction();
        tx.enlistResource(r1_1);
        tx.delistResource(r1_1, XAResource.TMSUCCESS);
        tx.commit();
        assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
        assertTrue(r1_1.isCommitted());
        assertTrue(!r1_1.isPrepared());
        assertTrue(!r1_1.isRolledback());
    }
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.