Examples of TransactionEntry


Examples of org.jboss.cache.transaction.TransactionEntry

         // 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;
         if (txTable.get(gtx) == null)
         {
            // create a new transaction entry

            entry = configuration.isNodeLockingOptimistic() ? new OptimisticTransactionEntry(ltx) : new TransactionEntry(ltx);
            log.debug("creating new tx entry");
            txTable.put(gtx, entry);
            if (trace) log.trace("TxTable contents: " + txTable);
         }
         else
View Full Code Here

Examples of org.jboss.cache.transaction.TransactionEntry

   {
      Option optionOverride = ctx.getOptionOverrides();
      if (optionOverride != null
            && (optionOverride.isForceAsynchronous() || optionOverride.isForceSynchronous()))
      {
         TransactionEntry entry = txTable.get(ctx.getGlobalTransaction());
         if (entry != null)
         {
            if (optionOverride.isForceAsynchronous())
               entry.setForceAsyncReplication(true);
            else
               entry.setForceSyncReplication(true);
         }
      }
   }
View Full Code Here

Examples of org.jboss.cache.transaction.TransactionEntry

   }


   private void cleanupStaleLocks(GlobalTransaction gtx) throws Throwable
   {
      TransactionEntry entry = txTable.get(gtx);
      if (entry != null)
      {
         entry.releaseAllLocksLIFO(gtx);
      }
   }
View Full Code Here

Examples of org.jboss.cache.transaction.TransactionEntry

      if (tx != null && !optimistic)
      {
         log.debug("Entering InvalidationInterceptor's prepare phase");
         // fetch the modifications before the transaction is committed (and thus removed from the txTable)
         gtx = ctx.getGlobalTransaction();
         TransactionEntry entry = txTable.get(gtx);
         if (entry == null) throw new IllegalStateException("cannot find transaction entry for " + gtx);
         List<MethodCall> modifications = new LinkedList<MethodCall>(entry.getModifications());
         if (modifications.size() > 0)
         {
            broadcastInvalidate(modifications, gtx, tx, ctx);
         }
         else
View Full Code Here

Examples of org.jboss.cache.transaction.TransactionEntry

      Transaction tx = ctx.getTransaction();
      if (tx != null)
      {
         // here we just record the modifications but actually do the invalidate in commit.
         gtx = ctx.getGlobalTransaction();
         TransactionEntry entry = txTable.get(gtx);
         if (entry == null) throw new IllegalStateException("cannot find transaction entry for " + gtx);
         modifications = new LinkedList<MethodCall>(entry.getModifications());
         if (modifications.size() > 0)
         {
            txMods.put(gtx, modifications);
         }
      }
View Full Code Here

Examples of org.jboss.cache.transaction.TransactionEntry

      if (trace) log.trace("Broadcasting call " + call + " to recipient list " + recipients);
      Transaction tx = ctx.getTransaction();
      if (tx != null)
      {
         GlobalTransaction gtx = ctx.getGlobalTransaction();
         TransactionEntry te = cache.getTransactionTable().get(gtx);
         if (te != null)
         {
            if (te.isForceAsyncReplication()) sync = false;
            else if (te.isForceSyncReplication()) sync = true;
         }
      }
      if (!sync && replicationQueue != null && !usingBuddyReplication)
      {
         putCallOnAsyncReplicationQueue(call);
View Full Code Here

Examples of org.jboss.cache.transaction.TransactionEntry

         timeout = ctx.getOptionOverrides().getLockAcquisitionTimeout();
      }
      try
      {
         TransactionWorkspace<?, ?> workspace = getTransactionWorkspace(gtx);
         TransactionEntry te = cache.getTransactionTable().get(gtx);
         if (log.isDebugEnabled()) log.debug("Locking nodes in transaction workspace for GlobalTransaction " + gtx);

         for (WorkspaceNode workspaceNode : workspace.getNodes().values())
         {
            NodeSPI node = workspaceNode.getNode();

            boolean isWriteLockNeeded = workspaceNode.isDirty() || (workspaceNode.isChildrenModified() && (configuration.isLockParentForChildInsertRemove() || node.isLockForChildInsertRemove()));

            boolean acquired = node.getLock().acquire(gtx, timeout, isWriteLockNeeded ? WRITE : READ);
            if (acquired)
            {
               if (trace) log.trace("Acquired lock on node " + node.getFqn());
               te.addLock(node.getLock());
            }
            else
            {
               throw new CacheException("Unable to acquire lock on node " + node.getFqn());
            }
View Full Code Here

Examples of org.jboss.cache.transaction.TransactionEntry

    *
    * @param gtx which holds locks
    */
   private void unlock(GlobalTransaction gtx)
   {
      TransactionEntry entry = txTable.get(gtx);
      entry.releaseAllLocksFIFO(gtx);
   }
View Full Code Here

Examples of org.jboss.cache.transaction.TransactionEntry

   }

   protected 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());
         txScopeOption.setSkipCacheStatusCheck(ctx.getOptionOverrides() != null && ctx.getOptionOverrides().isSkipCacheStatusCheck());
         entry.setOption(txScopeOption);
      }
   }
View Full Code Here

Examples of org.jboss.cache.transaction.TransactionEntry

   {
      if (t == null)
      {
         return false;
      }
      TransactionEntry entry = txTable.get(t);
      for (MethodCall m : entry.getCacheLoaderModifications())
      {
         if (m.getMethodId() == MethodDeclarations.removeNodeMethodLocal_id
               && fqn.isChildOrEquals((Fqn) m.getArgs()[1]))
         {
            return true;
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.