Package org.deuce.transaction

Examples of org.deuce.transaction.TransactionException


        else
          context.rollback();
        commit = true;
      }
    }
    throw new TransactionException("Failed to commit the transaction in the defined retries.");
  }
View Full Code Here


        else
          context.rollback();
        commit = true;
      }
    }
    throw new TransactionException("Failed to commit the transaction in the defined retries.");
  }
View Full Code Here

        else
          context.rollback();
        commit = true;
      }
    }
    throw new TransactionException("Failed to commit the transaction in the defined retries.");
  }
View Full Code Here

            pending = true;
          }
          try{ wait(); } catch (InterruptedException e) {};
          if(abortedPending.remove(context)){
            Logger.debug("Remotely aborting: " + context);
            throw new TransactionException();
          }
        }
        readers.add(context);
        break;
        case WRITE_MODE:
      // Get exclusive access.
      while (writer!=null || !readers.isEmpty() || ! writeValid) {
         if(writeValid){
          if(writer!=null){
            int res = HyFlow.getConflictManager().resolve(context, writer);
            if(res==0)
              writer = null;
            else if(res > 0)
              wait(res);
          }
          if(!readers.isEmpty()){
            int res = HyFlow.getConflictManager().resolve(context, readers);
            if(res==0)
              readers.clear();
            else if(res > 0)
              wait(res);
          }
          continue;
         }
        // Ask for object if absent.
        if (! writeValid && ! pending) {
          RetrieveRequest retrieve = new RetrieveRequest(context, key, mode);
          if (DEBUG)
            Aleph.debug(this + " sends " + retrieve + " to " + key.getHome());
          pendingContext = context;
          retrieve.send(key.getHome());
          pending = true;
        }
        try{ wait(); } catch (InterruptedException e) {};
        if(abortedPending.remove(context)){
          Logger.debug("Remotely aborting: " + context);
          throw new TransactionException();
        }
      }
      if(!context.status.equals(STATUS.ABORTED))
        writer = context;
      break;
View Full Code Here

                while(status.object==null){
                  Logger.debug("Wait Again for" + key);
                  wait()// wait again
                }
                release((AbstractDistinguishable)status.object);
                throw new TransactionException();
              }
              if ( ( System.currentTimeMillis() - start ) >= TIMEOUT ){
                context.rollback()// release other objects
                Logger.debug("Transaction Timeout :" + context);
                while(status.object==null){
                  Logger.debug("Wait Again for" + key);
                  wait()// wait again
                }
                release((AbstractDistinguishable)status.object);
                throw new TransactionException();
              }
          } catch (InterruptedException e) {}
         
          Logger.debug("Wakeup for remote " + key + " context " + context);
        }
View Full Code Here

TOP

Related Classes of org.deuce.transaction.TransactionException

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.