Examples of DbSequence


Examples of com.sleepycat.db.internal.DbSequence

                               final DatabaseEntry key,
                               SequenceConfig config)
        throws DatabaseException {

        config = SequenceConfig.checkNull(config);
        final DbSequence seq = config.openSequence(
            db, (txn == null) ? null : txn.txn, key);
        seq.remove((txn == null) ? null : txn.txn,
            (txn == null && db.get_transactional()) ?
            DbConstants.DB_AUTO_COMMIT | (config.getAutoCommitNoSync() ?
            DbConstants.DB_TXN_NOSYNC : 0) : 0);
    }
View Full Code Here

Examples of com.sleepycat.db.internal.DbSequence

    DbSequence createSequence(final Db db)
        throws DatabaseException {

        int createFlags = 0;

        return new DbSequence(db, createFlags);
    }
View Full Code Here

Examples of com.sleepycat.db.internal.DbSequence

    DbSequence openSequence(final Db db,
                    final DbTxn txn,
                    final DatabaseEntry key)
        throws DatabaseException {

        final DbSequence seq = createSequence(db);
        // The DB_THREAD flag is inherited from the database
        boolean threaded = ((db.get_open_flags() & DbConstants.DB_THREAD) != 0);

        int openFlags = 0;
        openFlags |= allowCreate ? DbConstants.DB_CREATE : 0;
        openFlags |= exclusiveCreate ? DbConstants.DB_EXCL : 0;
        openFlags |= threaded ? DbConstants.DB_THREAD : 0;

        if (db.get_transactional() && txn == null)
            openFlags |= DbConstants.DB_AUTO_COMMIT;

        configureSequence(seq, DEFAULT);
        boolean succeeded = false;
        try {
            seq.open(txn, key, openFlags);
            succeeded = true;
            return seq;
        } finally {
            if (!succeeded)
                try {
                    seq.close(0);
                } catch (Throwable t) {
                    // Ignore it -- an exception is already in flight.
                }
        }
    }
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.