Examples of TransactionEntry


Examples of org.jboss.cache.TransactionEntry

    }


    private void unlock(GlobalTransaction gtx)
    {
        TransactionEntry entry = txTable.get(gtx);
        entry.releaseAllLocksFIFO(gtx);
    }
View Full Code Here

Examples of org.jboss.cache.TransactionEntry

      return o;
   }

   private void cleanup(GlobalTransaction gtx)
   {
      TransactionEntry entry = tx_table.get(gtx);
      // Let's do it in stack style, LIFO
      entry.releaseAllLocksLIFO(gtx);

      Transaction ltx = entry.getTransaction();
      if (log.isTraceEnabled())
      {
         log.trace("removing local transaction " + ltx + " and global transaction " + gtx);
      }
      tx_table.remove(ltx);
View Full Code Here

Examples of org.jboss.cache.TransactionEntry

   private void commit(GlobalTransaction gtx)
   {
      if (log.isTraceEnabled())
         log.trace("committing cache with gtx " + gtx);

      TransactionEntry entry = tx_table.get(gtx);
      if (entry == null)
      {
         log.error("entry for transaction " + gtx + " not found (maybe already committed)");
         return;
      }

      // first remove nodes that should be deleted.
      Iterator removedNodes = entry.getRemovedNodes().iterator();
      while (removedNodes.hasNext())
      {
         Fqn f = (Fqn) removedNodes.next();
         cache.realRemove(f, false);
      }
View Full Code Here

Examples of org.jboss.cache.TransactionEntry

    *
    * @param tx
    */
   private void rollback(GlobalTransaction tx)
   {
      TransactionEntry entry = tx_table.get(tx);

      if (log.isTraceEnabled())
         log.trace("called to rollback cache with GlobalTransaction=" + tx);

      if (entry == null)
      {
         log.error("entry for transaction " + tx + " not found (transaction has possibly already been rolled back)");
         return;
      }

      Iterator removedNodes = entry.getRemovedNodes().iterator();
      while (removedNodes.hasNext())
      {
         Fqn f = (Fqn) removedNodes.next();
         cache.realRemove(f, false);

      }

      // Revert the modifications by running the undo-op list in reverse. This *cannot* throw any exceptions !
      entry.undoOperations(cache);
   }
View Full Code Here

Examples of org.jboss.cache.TransactionEntry

      boolean acquireLock = false; // do we need to acquire a lock if we load this node from cloader?
      Map nodeData = null;
      boolean initNode = false; // keep uninitialized
      Object key = null;
      InvocationContext ctx = getInvocationContext();
      TransactionEntry entry = null;
      GlobalTransaction gtx = null;
      if ((gtx = ctx.getGlobalTransaction()) != null)
      {
         entry = txTable.get(gtx);
      }
View Full Code Here

Examples of org.jboss.cache.TransactionEntry

   private boolean wasRemovedInTx(Fqn fqn)
   {
      GlobalTransaction t = getInvocationContext().getGlobalTransaction();
      if (t == null)
         return false;
      TransactionEntry entry = txTable.get(t);
      Iterator i = entry.getCacheLoaderModifications().iterator();
      while (i.hasNext())
      {
         JBCMethodCall m = (JBCMethodCall) i.next();
         if (m.getMethodId() == MethodDeclarations.removeNodeMethodLocal_id
                 && fqn.isChildOrEquals((Fqn) m.getArgs()[1]))
View Full Code Here

Examples of org.jboss.cache.TransactionEntry

      return o;
   }

   private void cleanup(GlobalTransaction gtx)
   {
      TransactionEntry entry = tx_table.get(gtx);
      // Let's do it in stack style, LIFO
      entry.releaseAllLocksLIFO(gtx);

      Transaction ltx = entry.getTransaction();
      if (log.isTraceEnabled())
      {
         log.trace("removing local transaction " + ltx + " and global transaction " + gtx);
      }
      tx_table.remove(ltx);
View Full Code Here

Examples of org.jboss.cache.TransactionEntry

   private void commit(GlobalTransaction gtx)
   {
      if (log.isTraceEnabled())
         log.trace("committing cache with gtx " + gtx);

      TransactionEntry entry = tx_table.get(gtx);
      if (entry == null)
      {
         log.error("entry for transaction " + gtx + " not found (maybe already committed)");
         return;
      }

      // first remove nodes that should be deleted.
      Iterator removedNodes = entry.getRemovedNodes().iterator();
      while (removedNodes.hasNext())
      {
         Fqn f = (Fqn) removedNodes.next();
         cache.realRemove(f, false);
      }
View Full Code Here

Examples of org.jboss.cache.TransactionEntry

    *
    * @param tx
    */
   private void rollback(GlobalTransaction tx)
   {
      TransactionEntry entry = tx_table.get(tx);

      if (log.isTraceEnabled())
         log.trace("called to rollback cache with GlobalTransaction=" + tx);

      if (entry == null)
      {
         log.error("entry for transaction " + tx + " not found (transaction has possibly already been rolled back)");
         return;
      }

      Iterator removedNodes = entry.getRemovedNodes().iterator();
      while (removedNodes.hasNext())
      {
         Fqn f = (Fqn) removedNodes.next();
         cache.realRemove(f, false);

      }

      // Revert the modifications by running the undo-op list in reverse. This *cannot* throw any exceptions !
      entry.undoOperations(cache);
   }
View Full Code Here

Examples of org.jboss.cache.TransactionEntry


    private void copyInvocationScopeOptionsToTxScope(InvocationContext ctx)
    {
        // notify the transaction entry that this override is in place.
        TransactionEntry entry = txTable.get(ctx.getGlobalTransaction());
        if (entry != null)
        {
            Option txScopeOption = new Option();
            txScopeOption.setCacheModeLocal(ctx.getOptionOverrides() != null && ctx.getOptionOverrides().isCacheModeLocal());
            entry.setOption(txScopeOption);
        }
    }
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.