Package com.sleepycat.je

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


            Transaction transaction = entityStore.getEnvironment().beginTransaction(null, null);
            try {
                copyTileSets(transaction);
                DeleteLayer deleteCommand = new DeleteLayer(oldLayerName);
                deleteCommand.call(transaction);
                transaction.commit();
            } catch (RuntimeException e) {
                transaction.abort();
                throw e;
            }
            return null;
View Full Code Here


                        pageStats.addTiles(tilesAdded, tilesPerPage);
                        pageStatsById.putNoReturn(tx, pageStats);
                    }
                }
                tx.commit();
                return null;
            } catch (RuntimeException e) {
                e.printStackTrace();
                tx.abort();
                throw e;
View Full Code Here

                    pageStats.addHitsAndAccessTime(addedHits, lastAccessTimeMinutes,
                            creationTimeMinutes);
                    pageStatsById.putNoReturn(tx, pageStats);
                    allStats.add(pageStats);
                }
                tx.commit();
                return allStats;
            } catch (RuntimeException e) {
                tx.abort();
                throw e;
            }
View Full Code Here

                PageStats pageStats = pageStatsByPageId.get(tx, tilePage.getId(), null);
                if (pageStats != null) {
                    pageStats.setFillFactor(0f);
                    pageStatsById.putNoReturn(tx, pageStats);
                }
                tx.commit();
                return pageStats;
            } catch (Exception e) {
                tx.abort();
                throw e;
            }
View Full Code Here

   
    Transaction txn = null;
    try {
      txn = env.beginTransaction(null, null);
      if (haveUser(txn, publicHash)) {
        txn.commit();
        return false;// User already exists
      }

      DatabaseEntry ph = new DatabaseEntry(publicHash);
      OperationStatus res = db.put(txn, USERS, ph);
View Full Code Here

      if (res != OperationStatus.SUCCESS) {
        log.severe("Could not add publicKey: " + res.toString());
        txn.abort();
        return false;
      }
      txn.commit();
      return true;
    } catch (DatabaseException e) {
      severe("Exception while adding user", e);
      try {
        if (txn != null) {
View Full Code Here

        } else {
          return false;
        }
      } finally {
        cursor.close();
        txn.commit();
      }
    } catch (DatabaseException e) {
      severe("Exception while deleting user", e);
      return false;
    }
View Full Code Here

      txn = env.beginTransaction(null, null);
      DatabaseEntry noncesKey = makeNoncesKey(publicKey);
      DatabaseEntry nonceValue = new DatabaseEntry(nonce.toToken());
      OperationStatus status = db.getSearchBoth(txn, noncesKey, nonceValue, null);
      if (status == OperationStatus.SUCCESS) {
        txn.commit();
        return false;// Nonce already used
      }
      status = db.put(txn, noncesKey, nonceValue);
      if (status == OperationStatus.SUCCESS) {
        txn.commit();
View Full Code Here

        txn.commit();
        return false;// Nonce already used
      }
      status = db.put(txn, noncesKey, nonceValue);
      if (status == OperationStatus.SUCCESS) {
        txn.commit();
        return true;
      } else {
        txn.abort();
        return false;
      }
View Full Code Here

    Transaction txn = null;
    try {
      txn = env.beginTransaction(null, null);
      OperationStatus lookupExists = db.getSearchBoth(txn, makeStoresKey(user), new DatabaseEntry(key), null);
      if (OperationStatus.SUCCESS != lookupExists){
        txn.commit();
        return null;
      }
      Collection<RevValue> collection = new ArrayList<RevValue>();
      Cursor cursor = db.openCursor(txn, null);
      try {
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.