Package org.jboss.cache.transaction

Examples of org.jboss.cache.transaction.GlobalTransaction


   {
      // pass up the chain.
      Object retval = invokeNextInterceptor(ctx, command);
      if (!skipReplicationOfTransactionMethod(ctx))
      {
         GlobalTransaction gtx = getGlobalTransaction(ctx);
         TransactionContext transactionContext = ctx.getTransactionContext();
         if (transactionContext.hasLocalModifications())
         {
            OptimisticPrepareCommand replicablePrepareCommand = command.copy(); // makre sure we remove any "local" transactions
            replicablePrepareCommand.removeModifications(transactionContext.getLocalModifications());
View Full Code Here


   @Override
   public Object visitCommitCommand(InvocationContext ctx, CommitCommand command) throws Throwable
   {
      //lets broadcast the commit first
      Throwable remoteCommitException = null;
      GlobalTransaction gtx = getGlobalTransaction(ctx);
      if (!gtx.isRemote() && ctx.isOriginLocal() && broadcastTxs.contains(gtx))
      {
         try
         {
            if (!skipReplicationOfTransactionMethod(ctx)) broadcastCommit(gtx, ctx);
         }
View Full Code Here

   @Override
   public Object visitRollbackCommand(InvocationContext ctx, RollbackCommand command) throws Throwable
   {
      //    lets broadcast the rollback first
      GlobalTransaction gtx = getGlobalTransaction(ctx);
      Throwable remoteRollbackException = null;
      if (!gtx.isRemote() && ctx.isOriginLocal() && broadcastTxs.contains(gtx))
      {
         //we dont do anything
         try
         {
            if (!skipReplicationOfTransactionMethod(ctx)) broadcastRollback(gtx, ctx);
View Full Code Here


   private GlobalTransaction getGlobalTransaction(InvocationContext ctx)
   {
      // get the current globalTransaction
      GlobalTransaction gtx = ctx.getGlobalTransaction();
      if (gtx == null)
      {
         throw new CacheException("failed to get global transaction");
      }
      return gtx;
View Full Code Here

   {
      //aditional setup
      command.setSkipSendingNodeEvents(true); //no notification
      nodes.adfNode.put("akey", "avalue");
      nodes.adfNode.setVersion(dataVersion);
      ctx.setGlobalTransaction(new GlobalTransaction());

      //check perform
      expect(container.peek(fqn)).andReturn(nodes.adfNode);
      // again
      expect(container.peek(fqn)).andReturn(nodes.adfNode);
View Full Code Here

      if (buddyManager.isDataGravitationRemoveOnFind())
      {
         if (trace)
            log.trace("DataGravitationCleanup: Removing primary (" + fqn + ") and backup (" + backup + ")");

         GlobalTransaction gtx = transactionTable.getCurrentTransaction();
         if (!executeRemove(gtx, fqn))
         {
            // only attempt to clean up the backup if the primary did not exist - a waste of a call otherwise.
            Object result = executeRemove(gtx, backup);
            if (wasNodeRemoved(result))
View Full Code Here

   @Override
   public NodeSPI<K, V> addChildDirect(Fqn f)
   {
      CacheSPI cache = getCache();
      NodeSPI<K, V> newNode = null;
      GlobalTransaction gtx = cache.getInvocationContext().getGlobalTransaction();

      if (f.size() == 1)
      {
         newNode = createChild(f.get(0), node, getCache(), version);
      }
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);

      TransactionWorkspace workspace = entry.getTransactionWorkSpace();
View Full Code Here

      setupTransactions(cache, tx);

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

      GlobalTransaction gtx = table.get(tx);

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

      //assert we can see this with a key value get in the transaction
      assertEquals(0, cache.getRoot().getChildrenNames().size());
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

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.