Package com.sleepycat.je.txn

Examples of com.sleepycat.je.txn.LockType


                    if (!getMode.isForward()) {
                        rangeLockCurrentPosition(getMode);
                    }

                    /* Use a range lock if performing a 'next' operation. */
                    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. */
        LockType lockType = getLockType(lockMode, true);
        OperationStatus status;
        boolean noNextKeyFound;

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

                                       DatabaseEntry data,
                                       LockMode lockMode)
        throws DatabaseException {

        /* Do not use a range lock. */
        LockType lockType = getLockType(lockMode, false);

        return cursorImpl.getCurrent(key, data, lockType);
    }
View Full Code Here

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

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

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

View Full Code Here

                           LockMode lockMode,
                           SearchMode searchMode)
        throws DatabaseException {

        if (!isSerializableIsolation(lockMode)) {
            LockType lockType = getLockType(lockMode, false);
            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. */
                LockType searchLockType = getLockType(lockMode, false);

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

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

                    if (!getMode.isForward()) {
                        rangeLockCurrentPosition(getMode);
                    }

                    /* Use a range lock if performing a 'next' operation. */
                    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. */
        LockType lockType = getLockType(lockMode, true);
        OperationStatus status;
        boolean noNextKeyFound;

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

                                       DatabaseEntry data,
                                       LockMode lockMode)
        throws DatabaseException {

        /* Do not use a range lock. */
        LockType lockType = getLockType(lockMode, false);

        return cursorImpl.getCurrent(key, data, lockType);
    }
View Full Code Here

             * for long, as that will cause deadlocks with splits and
             * checkpointing.
       */
      Locker locker = null;
      CursorImpl cursor = null;
            LockType lockType = LockType.NONE;
      try {
    locker = new BasicLocker(envImpl);
    cursor = new CursorImpl(idDatabase, locker);
    if (cursor.positionFirstOrLast(true, null)) {
                    MapLN mapLN = (MapLN) cursor.
View Full Code Here

             * from each db verify invalidate the cursor.  Use dirty read
             * (LockMode.NONE) because locks on the MapLN should never be held
             * for long, as that will cause deadlocks with splits and
             * checkpointing.
             */
            final LockType lockType = LockType.NONE;
            class Traversal implements CursorImpl.WithCursor {
                boolean allOk = true;

                public boolean withCursor(CursorImpl cursor,
                                          DatabaseEntry key,
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.