Package com.sleepycat.je.txn

Examples of com.sleepycat.je.txn.LockType


                    if (!first) {
                        cursorImpl.lockEofNode(LockType.RANGE_READ);
                    }

                    /* Use a range lock for getFirst. */
                    final LockType lockType = getLockType(lockMode, first);

                    /* Perform operation. */
                    final OperationStatus status =
                        positionAllowPhantoms(key, data, lockType, first);

View Full Code Here


                           final DatabaseEntry data,
                           final LockMode lockMode,
                           final SearchMode searchMode) {
        try {
            if (!isSerializableIsolation(lockMode)) {
                final LockType lockType = getLockType(lockMode, false);
                final KeyChangeStatus result = searchAllowPhantoms
                    (key, data, lockType, lockType, searchMode);
                return result.status;
            }

            /*
             * Perform range locking to prevent phantoms and handle restarts.
             */
            while (true) {
                try {
                    /* Do not use a range lock for the initial search. */
                    final LockType searchLockType =
                        getLockType(lockMode, false);

                    /* Switch to a range lock when advancing forward. */
                    final LockType advanceLockType =
                        getLockType(lockMode, true);

                    /* Do not modify key/data params until SUCCESS. */
                    final DatabaseEntry tryKey = new DatabaseEntry
                        (key.getData(), key.getOffset(), key.getSize());
View Full Code Here

                        }

                        /*
                         * Use a range lock if performing a 'next' operation.
                         */
                        final LockType lockType =
                            getLockType(lockMode, getMode.isForward());

                        /* Perform the operation. */
                        status = retrieveNextAllowPhantoms
                            (key, data, lockType, getMode);
View Full Code Here

        /* Do not modify key/data params until SUCCESS. */
        DatabaseEntry tryKey = new DatabaseEntry();
        DatabaseEntry tryData = new DatabaseEntry();

        /* Get a range lock. */
        final LockType lockType = getLockType(lockMode, true);
        OperationStatus status;
        boolean noNextKeyFound;

        /*
         * Perform a NEXT and return NOTFOUND if the key changes
View Full Code Here

     */
    OperationStatus getCurrentInternal(final DatabaseEntry key,
                                       final DatabaseEntry data,
                                       final LockMode lockMode) {
        /* Do not use a range lock. */
        final LockType lockType = getLockType(lockMode, false);

        beginUseExistingCursor();
        final OperationStatus status =
            cursorImpl.getCurrent(key, data, lockType);
        endUseExistingCursor();
View Full Code Here

TOP

Related Classes of com.sleepycat.je.txn.LockType

Copyright © 2018 www.massapicom. 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.