Package com.sleepycat.je

Examples of com.sleepycat.je.Transaction.abort()


      status = db.put(txn, noncesKey, nonceValue);
      if (status == OperationStatus.SUCCESS) {
        txn.commit();
        return true;
      } else {
        txn.abort();
        return false;
      }
    } catch (DatabaseException e) {
      severe("Exception while checking nonce for user", e);
      try {
View Full Code Here


      }
    } catch (DatabaseException e) {
      severe("Exception while checking nonce for user", e);
      try {
        if (txn != null)
          txn.abort();
      } catch (DatabaseException e1) {
        // we already had a failure, ignore this one.
      }
      return false;
    }
View Full Code Here

    } catch (DatabaseException e) {
      severe("Exception while getting record", e);
      try {
        if (txn != null)
          txn.abort();
      } catch (DatabaseException e1) {
        // we already had a failure, ignore this one.
      }
      throw new IOException(e);
    }
View Full Code Here

      } catch (DatabaseException e1) {
        // already caught one so ignore this one
      }
      try {
        if (txn != null)
          txn.abort();
      } catch (DatabaseException e1) {
        // already caught one so ignore this one
      }
      throw new IOException(e);
    }
View Full Code Here

      }
      return revisions;
    } catch (DatabaseException e) {
      if (txn != null) {
        try {
          txn.abort();
        } catch (DatabaseException e1) {
          // we already had a failure, ignore this one.
        }
      }
      throw new IOException(e);
View Full Code Here

      if (OperationStatus.NOTFOUND == lookupExists){
        // insert lookup
        lookupExists = db.put(txn, storesKey, lookup);
      }
      if (OperationStatus.SUCCESS != lookupExists){
        txn.abort();
        return false;
      }
      byte[] lookupKey = makeLookupBytes(user,key);
      DatabaseEntry lookupEntry = new DatabaseEntry(lookupKey);
      DatabaseEntry revisionEntry = new DatabaseEntry(revision);
View Full Code Here

      byte[] lookupKey = makeLookupBytes(user,key);
      DatabaseEntry lookupEntry = new DatabaseEntry(lookupKey);
      DatabaseEntry revisionEntry = new DatabaseEntry(revision);
      OperationStatus revisionExists = db.getSearchBoth(txn, lookupEntry, revisionEntry, null);
      if (OperationStatus.SUCCESS == revisionExists){// already exists, abort
        txn.abort();
        return false;
      }
      // Does not exist, make it exist.
      revisionExists = db.put(txn, lookupEntry, revisionEntry);
      if (OperationStatus.SUCCESS != revisionExists){
View Full Code Here

        return false;
      }
      // Does not exist, make it exist.
      revisionExists = db.put(txn, lookupEntry, revisionEntry);
      if (OperationStatus.SUCCESS != revisionExists){
        txn.abort();
        log.warning("Could not put revision: " + revisionExists.toString());
        return false;
      }
      OperationStatus putValue = db.put(txn, new DatabaseEntry(makeBytes(lookupKey,SEPARATOR,revision)), new DatabaseEntry(data));
      if (OperationStatus.SUCCESS != putValue){
View Full Code Here

        log.warning("Could not put revision: " + revisionExists.toString());
        return false;
      }
      OperationStatus putValue = db.put(txn, new DatabaseEntry(makeBytes(lookupKey,SEPARATOR,revision)), new DatabaseEntry(data));
      if (OperationStatus.SUCCESS != putValue){
        txn.abort();
        log.warning("Could not put value: " + putValue.toString());
        return false;
      }
      txn.commit();
      return true;
View Full Code Here

      return true;
    } catch (DatabaseException e){
      severe("Exception while putting record", e);
      try {
        if (txn != null)
          txn.abort();
      } catch (DatabaseException e1) {
        // we already had a failure, ignore this one.
      }
      return false;
    }
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.