Package com.sleepycat.je

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


            assertFalse(DbInternal.dbGetDatabaseImpl(testDb).getTree().validateDelete(0));
            assertFalse(DbInternal.dbGetDatabaseImpl(testDb).getTree().validateDelete(1));

            // XXX, now commit the delete and compress and test that the
            // subtree is deletable. Not finished yet! Also must test deletes.
            txn.abort();
        } catch (Exception e) {
            e.printStackTrace();
            throw e;
        }
    }
View Full Code Here


            /*
             * Should be able to delete, the txn is aborted and the data
             * isn't there.
             */
            txn.abort();
            assertTrue(tree.validateDelete(0));

            /*
             * Try explicit deletes.
             */
 
View Full Code Here

        /*
         * Abort the transaction to revert to the original node ID for key 0.
         * Then perform a delete with a new transaction.  This makes the
         * current LN for key 0 deleted.
         */
        txn.abort();
        txn = env.beginTransaction(null, null);
        key.setData(TestUtils.getTestArray(0));
        status = db.delete(txn, key);
        assertEquals(OperationStatus.SUCCESS, status);

View Full Code Here

        cursor.close();
        if (commit) {
            txn.commit();
        } else {
            txn.abort();
        }
    }
    /**
     * Delete data.
     */
 
View Full Code Here

        cursor.close();
        if (commit) {
            txn.commit();
        } else {
            txn.abort();
        }
    }

    /**
     * Check what's in the database against what's in the expected map.
View Full Code Here

        int count1 = getObsoleteLNCount();
        Transaction txn = env.beginTransaction(null, null);
        int nTruncated = db.truncate(txn, true);
        assertEquals(RECORD_COUNT, nTruncated);
        assertEquals(0, countRecords());
        txn.abort();

        /* Abort after truncate closes the db -- reopen it. */
        openDb();

        assertEquals(RECORD_COUNT, countRecords());
View Full Code Here

        int count1 = getObsoleteLNCount();
        db.close();
        db = null;
        Transaction txn = env.beginTransaction(null, null);
        env.removeDatabase(txn, DB_NAME);
        txn.abort();
        int count2 = getObsoleteLNCount();

        openDb();
        assertEquals(RECORD_COUNT, countRecords());
View Full Code Here

            for (int t = 0; t < numTxns; t++) {
                Transaction txn = txns[t];
                if (endMode.equals(COMMIT)) {
                    txn.commit();
                } else {
                    txn.abort();
                }
            }

            long afterTxnEnd = mb.getCacheMemoryUsage();
View Full Code Here

        cursor.close();
        env.compress();
        checkBinEntriesAndCursors(bin, 3, 0);

        /* Abort without calling compress does not compress. */
        txn.abort();
        checkBinEntriesAndCursors(bin, 3, 0);

        /* Finally compress can compress. */
        env.compress();
        checkBinEntriesAndCursors(bin, 2, 0);
View Full Code Here

        status = db.putNoDupData(txn, key, data);
        StringBinding.stringToEntry("A", key);
        StringBinding.stringToEntry("B", data);
        status = db.putNoDupData(txn, key, data);
        assertEquals(OperationStatus.SUCCESS, status);
        txn.abort();

        /*
         * Close without a checkpoint and recover.  Before the bug fix, the
         * recovery would throw DatabaseException "attempt to fetch a deleted
         * entry".
 
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.