Package javax.transaction

Examples of javax.transaction.Transaction.commit()


      if (tx == null)
         throw new IllegalStateException("thread not associated with transaction");
      status = tx.getStatus();
      if (status == Status.STATUS_MARKED_ROLLBACK)
         throw new RollbackException();
      tx.commit();

      // Disassociate tx from thread.
      setTransaction(null);
   }
View Full Code Here


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

      tl.tm.resume(t2);
      t2.commit();

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

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

      tl.tm.resume(t2);
      t2.commit();

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

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

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

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

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

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

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

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

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

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

            case REQUIRES:
                // Are we the owner of the transaction?
                Transaction transaction = m_owned.get(Thread.currentThread());
                if (transaction != null) { // Owner.
                    try {
                        transaction.commit(); // Commit the transaction
                        m_owned.remove(Thread.currentThread());
                        handler.transactionCommitted(transaction); // Manage potential notification.
                    } catch ( RollbackException e) {
                        m_owned.remove(Thread.currentThread());
                        // The transaction was rolledback
View Full Code Here

                System.out.println("== Owned " + Thread.currentThread() + " to " + transaction + "==");
                if (transaction == null) {
                    throw new RuntimeException("Cannot apply the REQUIRES NEW propagation, we're not the transaction owner!");
                }
                try {
                    transaction.commit(); // Commit the transaction
                    m_owned.remove(Thread.currentThread());
                    handler.transactionCommitted(transaction); // Manage potential notification.
                    if (suspended != null) {
                        manager.suspend(); // suspend the completed transaction.
                        manager.resume(suspended);
View Full Code Here

         // Validates TX convertion
         assertFalse(state.getCurrentTxId() instanceof LocalTx);

         trans.delistResource(resource, XAResource.TMSUCCESS);

         trans.commit();

         // After commit the message should be consumed
         count = (Integer) ServerManagement.getAttribute(queueMBean, "MessageCount");
         assertEquals(0, count.intValue());
      }
View Full Code Here

         assertEquals("one", messageReceived.getText());

         count = (Integer)ServerManagement.getAttribute(queueMBean, "MessageCount");
         assertEquals(1, count.intValue());

         trans.commit();

         count = (Integer)ServerManagement.getAttribute(queueMBean, "MessageCount");
         assertEquals(0, count.intValue());

      }
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.