Package org.jboss.cache.transaction

Examples of org.jboss.cache.transaction.GlobalTransaction


   private void nullOwner() throws InterruptedException
   {
      log("testNullOwner ...");
      try
      {
         GlobalTransaction gtx = getGlobalTransactionFromThread();
         lock_.acquireWriteLock(gtx, 50);
         lock_.release(gtx);

         lock_.acquireReadLock(gtx, 50);
         lock_.release(gtx);
View Full Code Here


   private void nullOwner2() throws InterruptedException
   {
      log("testNullOwner2 ...");
      try
      {
         GlobalTransaction gtx = getGlobalTransactionFromThread();
         lock_.acquireReadLock(gtx, 50);
         lock_.acquireWriteLock(gtx, 50);// this should succeed
         lock_.release(gtx);
      }
      catch (LockingException e)
View Full Code Here

   private void nullOwner3() throws InterruptedException
   {
      log("testNullOwner3 ...");
      try
      {
         GlobalTransaction gtx = getGlobalTransactionFromThread();
         lock_.acquireWriteLock(gtx, 50);
         lock_.acquireReadLock(gtx, 50);// this should succeed
         lock_.release(gtx);
      }
      catch (LockingException e)
View Full Code Here

      cache.put("/one/two", "key1", pojo);

      assertEquals(null, dummy.getCalledCommand());
      TransactionTable table = cache.getTransactionTable();

      GlobalTransaction gtx = table.get(tx);

      OptimisticTransactionContext entry = (OptimisticTransactionContext) table.get(gtx);

      @SuppressWarnings("unchecked")
      TransactionWorkspace<Object, Object> workspace = entry.getTransactionWorkSpace();
View Full Code Here

      cache.put("/one/two", "key1", pojo2);

      assertEquals(null, dummy.getCalledCommand());
      TransactionTable table = cache.getTransactionTable();

      GlobalTransaction gtx = table.get(tx);

      OptimisticTransactionContext entry = (OptimisticTransactionContext) table.get(gtx);

      @SuppressWarnings("unchecked")
      TransactionWorkspace<Object, Object> workspace = entry.getTransactionWorkSpace();
View Full Code Here

      cache.put("/one/two", "key1", null);

      assertEquals(null, dummy.getCalledCommand());
      TransactionTable table = cache.getTransactionTable();

      GlobalTransaction gtx = table.get(tx);

      OptimisticTransactionContext entry = (OptimisticTransactionContext) table.get(gtx);

      @SuppressWarnings("unchecked")
      TransactionWorkspace<Object, Object> workspace = entry.getTransactionWorkSpace();
View Full Code Here

      assertEquals(null, dummy.getCalledCommand());
      TransactionTable table = cache.getTransactionTable();


      GlobalTransaction gtx = table.get(tx);

      OptimisticTransactionContext entry = (OptimisticTransactionContext) table.get(gtx);

      @SuppressWarnings("unchecked")
      TransactionWorkspace<Object, Object> workspace = entry.getTransactionWorkSpace();

      //resume the suspended transaction
      GlobalTransaction gtx2 = table.get(tx2);

      OptimisticTransactionContext entry2 = (OptimisticTransactionContext) table.get(gtx2);

      @SuppressWarnings("unchecked")
      TransactionWorkspace<Object, Object> workspace2 = entry2.getTransactionWorkSpace();
View Full Code Here

      AbstractLockManagerRecordingTestTL tl = threadLocal.get();
      LockManager lm = tl.lm;
      Fqn fqn = Fqn.fromString("/a/b/c");
      NodeSPI node = createNode(fqn);
      InvocationContext ctx = tl.icc.get();
      ctx.setGlobalTransaction(new GlobalTransaction());
      ctx.setTransaction(new DummyTransaction(DummyTransactionManager.getInstance()));
      ctx.setTransactionContext(tl.contextFactory.createTransactionContext(ctx.getTransaction()));

      // lock and record.
      lm.lockAndRecord(node, WRITE, ctx);
View Full Code Here

      mgr.suspend();

      assertEquals(1, cache.getTransactionTable().getNumGlobalTransactions());
      assertEquals(1, cache.getTransactionTable().getNumLocalTransactions());

      GlobalTransaction gtx = cache.getCurrentTransaction(tx, true);
      TransactionTable table = cache.getTransactionTable();
      OptimisticTransactionContext entry = (OptimisticTransactionContext) table.get(gtx);

      assertEquals(3, entry.getTransactionWorkSpace().getNodes().size());
      assertNull(mgr.getTransaction());
View Full Code Here

   {
      InvocationContextContainer icc = getInvocationContextContainer();
      OwnableReentrantLock lock = new OwnableReentrantLock(icc);

      // create and set a gtx
      GlobalTransaction gtx = new GlobalTransaction();
      gtx.setId(10);
      icc.get().setGlobalTransaction(gtx);

      lock.lock(); // locked by current thread
      assert lock.getOwner().equals(gtx);
      assert lock.getHoldCount() == 1;
View Full Code Here

TOP

Related Classes of org.jboss.cache.transaction.GlobalTransaction

Copyright © 2018 www.massapicom. 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.