Package org.infinispan.context

Examples of org.infinispan.context.TransactionContext


      GlobalTransaction gtx = get(tx);
      if (gtx == null && createIfNotExists) {
         Address addr = getAddress();
         gtx = GlobalTransaction.create(addr);
         if (trace) log.trace("Creating new GlobalTransaction " + gtx);
         TransactionContext transactionContext;
         try {
            transactionContext = contextFactory.createTransactionContext(tx);
         }
         catch (Exception e) {
            throw new CacheException("Unable to create a transaction entry!", e);
View Full Code Here


   public TransactionContext getTransactionContext(GlobalTransaction gtx) {
      return gtxMapping.get(gtx);
   }

   public void cleanup(GlobalTransaction gtx) {
      TransactionContext ctx = gtxMapping.remove(gtx);
      if (ctx != null) txMapping.remove(ctx.getTransaction());
   }
View Full Code Here

      // Is there a local transaction associated with GTX?  (not the current tx associated with the thread, which may be
      // in the invocation context
      Transaction ltx = txTable.getLocalTransaction(gtx);
      Transaction currentTx = txManager.getTransaction();
      TransactionContext transactionContext;
      Object retval = null;
      boolean success = false;
      try {
         if (ltx == null) {
            if (currentTx != null) txManager.suspend();
View Full Code Here

            throw new RuntimeException("Commit failed.", e);
      }
   }

   protected void cleanupStaleLocks(InvocationContext ctx) throws Throwable {
      TransactionContext transactionContext = ctx.getTransactionContext();
      if (transactionContext != null) lockManager.unlock(ctx);
   }
View Full Code Here

      GlobalTransaction gtx;

      if (transactions.add(tx)) {
         gtx = txTable.getCurrentTransaction(tx, true);
         TransactionContext transactionContext;
         if (ctx.getGlobalTransaction() == null) {
            ctx.setGlobalTransaction(gtx);
            transactionContext = txTable.getTransactionContext(gtx);
            ctx.setTransactionContext(transactionContext);
         } else {
View Full Code Here

   }

   @Override
   public Object visitPrepareCommand(InvocationContext ctx, PrepareCommand command) throws Throwable {
      Object retVal = invokeNextInterceptor(ctx, command);
      TransactionContext transactionContext = ctx.getTransactionContext();
      if (transactionContext.hasLocalModifications()) {
         PrepareCommand replicablePrepareCommand = command.copy(); // make sure we remove any "local" transactions
         replicablePrepareCommand.removeModifications(transactionContext.getLocalModifications());
         command = replicablePrepareCommand;
      }

      boolean sync = isSynchronous(ctx);
View Full Code Here

TOP

Related Classes of org.infinispan.context.TransactionContext

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.