Package org.jboss.cache.transaction

Examples of org.jboss.cache.transaction.TransactionEntry


    * transaction.
    * This is O(N) WRT to the number of modifications so far.
    */
   private boolean wasRemovedInTx(Fqn fqn, InvocationContext ctx)
   {
      TransactionEntry entry = ctx.getTransactionEntry();
      if (entry == null) return false;

      for (ReversibleCommand txCacheCommand : entry.getModifications())
      {
         if (txCacheCommand instanceof RemoveNodeCommand && fqn.isChildOrEquals(txCacheCommand.getFqn())) return true;
      }
      return false;
   }
View Full Code Here


   public static void manageReverseRemove(InvocationContext ctx, NodeSPI childNode, boolean reverseRemoveCheck, List createdNodes, CommandsFactory commandsFactory)
   {
      if (ctx.getGlobalTransaction() != null) //if no tx then reverse remove does not make sense
      {
         Fqn fqn = childNode.getFqn();
         TransactionEntry entry = ctx.getTransactionEntry();
         boolean needToReverseRemove = reverseRemoveCheck && childNode.isDeleted() && entry != null && entry.getRemovedNodes().contains(fqn);
         if (!needToReverseRemove) return;
         childNode.markAsDeleted(false);
         //if we'll rollback the tx data should be added to the node again
         Map oldData = new HashMap(childNode.getDataDirect());
         PutDataMapCommand command = commandsFactory.buildPutDataMapCommand(ctx.getGlobalTransaction(), fqn, oldData);
         // txTable.get(gtx).addUndoOperation(command); --- now need to make sure this is added to the normal mods list instead
         entry.addModification(command);
         //we're prepared for rollback, now reset the node
         childNode.clearDataDirect();
         if (createdNodes != null)
         {
            createdNodes.add(childNode);
View Full Code Here

         // Asssociate the local TX with the global TX. Create new
         // entry for TX in txTable, the modifications
         // below will need this entry to add their modifications
         // under the GlobalTx key
         TransactionEntry entry = txTable.get(gtx);
         if (entry == null)
         {
            // create a new transaction entry
            if (trace) log.trace("creating new tx entry");
            entry = createNewTransactionEntry(ltx);
View Full Code Here

      return retval;
   }

   protected TransactionEntry createNewTransactionEntry(Transaction tx) throws Exception
   {
      return new TransactionEntry(tx);
   }
View Full Code Here

      }
   }

   protected void cleanupStaleLocks(InvocationContext ctx) throws Throwable
   {
      TransactionEntry entry = ctx.getTransactionEntry();
      if (entry != null) lockManager.unlock(ctx);
   }
View Full Code Here

      GlobalTransaction gtx;

      if (TransactionTable.isValid(tx) && transactions.add(tx))
      {
         gtx = txTable.getCurrentTransaction(tx, true);
         TransactionEntry entry;
         if (ctx.getGlobalTransaction() == null)
         {
            ctx.setGlobalTransaction(gtx);
            entry = txTable.get(gtx);
            ctx.setTransactionEntry(entry);
View Full Code Here

TOP

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

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.