Package com.sleepycat.je

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


      return result;
    } catch (DatabaseException e) {
      severe("Exception while deleting 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


        TransactionConfig config = new TransactionConfig();
        config.setSerializableIsolation(true);
        config.setReadUncommitted(true);
        try {
            Transaction txn = env.beginTransaction(null, config);
            txn.abort();
            fail();
        } catch (IllegalArgumentException expected) {
        }
        closeEnv();
    }
View Full Code Here

                status = db.putNoDupData(writerTxn, key, data);
            } else {
                status = db.putNoOverwrite(writerTxn, key, data);
            }
        } catch (DeadlockException e) {
            writerTxn.abort();
            throw e;
        }
        assertEquals(OperationStatus.SUCCESS, status);
        writerTxn.commitNoSync();
    }
View Full Code Here

      status =
    c.put(new StringDbt("oneKey"),
          new StringDbt("secondData"));
      assertEquals(OperationStatus.SUCCESS, status);
      c.close();
      txn.abort();
      txn = exampleEnv.beginTransaction(null, null);
      c = exampleDb.openCursor(txn, null);
      DatabaseEntry keyRet = new DatabaseEntry();
      DatabaseEntry dataRet = new DatabaseEntry();
      assertEquals(OperationStatus.SUCCESS,
View Full Code Here

            Hashtable expectedData = new Hashtable();
           
            /* Insert all the data. */
            Transaction txn = env.beginTransaction(null, null);
            insertData(txn, 0, numRecs - 1, expectedData, 1, false, NUM_DBS);
            txn.abort();
            closeEnv();
            recoverAndVerify(expectedData, NUM_DBS);
        } catch (Throwable t) {
            /* Print stacktrace before trying to clean up files. */
            t.printStackTrace();
View Full Code Here

            verifyData(expectedData, false, NUM_DBS);
           
            /* Insert N - 3N and abort. */
            txn = env.beginTransaction(null, null);
            insertData(txn, N, (3 * N) - 1, expectedData, 1, false, NUM_DBS);
            txn.abort();
            verifyData(expectedData, false, NUM_DBS);

            /*
       * Wait for the incompressor queue to be processed, so we force the
       * recovery to run w/IN delete replays.
View Full Code Here

            txn.commit();

            /* Delete all and abort. */
            txn = env.beginTransaction(null, null);
            deleteData(txn, expectedData, true, false, NUM_DBS);
            txn.abort();

            /* Delete every other and commit. */
            txn = env.beginTransaction(null, null);
            deleteData(txn, expectedData, false, true, NUM_DBS);
            txn.commit();
View Full Code Here

            txn.commit();
           
            /* Modify some and abort. */
            txn = env.beginTransaction(null, null);
            modifyData(txn, numRecs, expectedData, 3, false, NUM_DBS);
            txn.abort();

            /* Modify some and commit. */
            txn = env.beginTransaction(null, null);
            modifyData(txn, numRecs/2, expectedData, 2, true, NUM_DBS);
            txn.commit();
View Full Code Here

            /* Delete all and abort. */
            txn = env.beginTransaction(null, null);
            deleteData(txn, expectedData, true, false, NUM_DBS);
            insertData(txn, 0, numRecs, expectedData, 1, false, NUM_DBS);
            txn.abort();

            txn = env.beginTransaction(null, null);
      verifyData(expectedData, NUM_DBS);
            txn.commit();

View Full Code Here

            /* Delete all and abort. */
            txn = env.beginTransaction(null, null);
            deleteData(txn, expectedData, true, false, NUM_DBS);
            insertData(txn, 0, numRecs, expectedData, 1, false, NUM_DBS);
            deleteData(txn, expectedData, true, false, NUM_DBS);
            txn.abort();

            if (DEBUG) {
                dumpData(NUM_DBS);
                dumpExpected(expectedData);
                com.sleepycat.je.tree.Key.DUMP_BINARY = 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.