Package com.sleepycat.je

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


            dbConfig.setTransactional(true);
            dbConfig.setAllowCreate(true);
            for (int i = 0; i < N2; i++) {
                Database db = env.openDatabase(txn, dbName1 + i, dbConfig);
            }
            txn.abort();
           
            /* All dbs should not exist */
            checkForNoDb(dbName1, 0, N2);

            /* Make more dbs, overlapping with some of the aborted set. */
 
View Full Code Here


            /* Remove some dbs, abort */
            txn = env.beginTransaction(null, null);
            for (int i = N2; i < N4; i++) {
                env.removeDatabase(txn, dbName1+i);
            }
            txn.abort();

            /* Remove some dbs, commit */
            txn = env.beginTransaction(null, null);
            for (int i = N3; i < N4; i++) {
                env.removeDatabase(txn, dbName1+i);
View Full Code Here

            txn = env.beginTransaction(null, null);
            for (int i = N1; i < N3; i++) {
                env.renameDatabase
        (txn, dbName1+i, dbName2+i);
            }
            txn.abort();

            /* Remove some dbs, commit */
            txn = env.beginTransaction(null, null);
            for (int i = N2; i < N3; i++) {
                env.renameDatabase
View Full Code Here

    fail("unexpected DatabaseException");
      }

      try {
    if (abort) {
        txn.abort();
    } else {
        txn.commit();
    }
      } catch (DatabaseException DE) {
    fail("unexpected DatabaseException");
View Full Code Here

  writeAndVerify(null, true, "k2", "d2", doRecovery);
  writeAndVerify(null, false, "k3", "d3", doRecovery);

  txn = env.beginTransaction(null, null);
  writeAndVerify(txn, false, "k4", "d4", false);
  txn.abort();
  verify(null, true, "k4", doRecovery);
  verify(null, false, "k1", doRecovery);
  verify(null, false, "k3", doRecovery);

  txn = env.beginTransaction(null, null);
View Full Code Here

  txn = env.beginTransaction(null, null);
  writeAndVerify(txn, true, "k5", "d5", false);
  /* Ensure that writes after IOExceptions don't succeed. */
  writeAndVerify(txn, false, "k5a", "d5a", false);
  txn.abort();
  verify(null, true, "k5", doRecovery);
  verify(null, true, "k5a", doRecovery);

  txn = env.beginTransaction(null, null);
  writeAndVerify(txn, false, "k6", "d6", false);
View Full Code Here

  c.delete();
  for (int i = 1; i < 3; i++) {
      c.put(simpleKeys[0], simpleData[i]);
  }
  c.close();
  txn.abort();
  txn = exampleEnv.beginTransaction(null, null);
  c = exampleDb.openCursor(txn, null);
  assertEquals(OperationStatus.NOTFOUND,
         c.getFirst(new DatabaseEntry(),
        new DatabaseEntry(),
View Full Code Here

      }

        } catch (DeadlockException DBE) {
        } finally {
      cursor1.close();
      txn1.abort();
      sequence = 4;
        }
    }
      };
View Full Code Here

      }

        } catch (DeadlockException DBE) {
        } finally {
      cursor2.close();
      txn2.abort();
      sequence = 4;
        }
    }
      };
View Full Code Here

            /*
             * Should be able to delete both, the txn is aborted and the data
             * isn't there.
             */
            txn.abort();
            assertTrue(DbInternal.dbGetDatabaseImpl(testDb).getTree().validateDelete(0));
            assertTrue(DbInternal.dbGetDatabaseImpl(testDb).getTree().validateDelete(1));


            /*
 
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.