Package com.sleepycat.je.txn

Examples of com.sleepycat.je.txn.LockType


             * 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,
                                          @SuppressWarnings("unused")
View Full Code Here


    private long skipInternal(final long maxCount,
                              final boolean forward,
                              final DatabaseEntry key,
                              final DatabaseEntry data,
                              final LockMode lockMode) {
        final LockType lockType = getLockType(lockMode, false);
        synchronized (getTxnSynchronizer()) {
            checkTxnState();
            while (true) {
                final CursorImpl dup = beginMoveCursor(true);
                boolean success = false;
View Full Code Here

                return (cmp != 0) ? cmp : 1;
            }
        };

        OperationStatus status = OperationStatus.NOTFOUND;
        final LockType lockType = getLockType(lockMode, false);
        final CursorImpl dup =
            beginMoveCursor(false /* searchAndPosition will add cursor */);
        try {
            final KeyChangeStatus result =
                searchInternal(dup, key, data,
View Full Code Here

                    if (!first) {
                        cursorImpl.lockEof(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 SearchMode searchMode,
         final Comparator<byte[]> searchComparator) {

        try {
            if (!isSerializableIsolation(lockMode)) {
                final LockType lockType = getLockType(lockMode, false);
                final KeyChangeStatus result = searchAllowPhantoms
                    (key, data, lockType, lockType, searchMode,
                     searchComparator, cursorRangeConstraint);
                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 = cloneEntry(key);
                    final DatabaseEntry tryData = cloneEntry(data);
View Full Code Here

                    /* Get a range lock for 'prev' operations. */
                    if (!getMode.isForward()) {
                        rangeLockCurrentPosition(getMode);
                    }
                    /* Use a range lock if performing a 'next' operation. */
                    final LockType lockType =
                        getLockType(lockMode, getMode.isForward());

                    /* Do not modify key/data params until SUCCESS. */
                    final DatabaseEntry tryKey = cloneEntry(key);
                    final DatabaseEntry tryData = cloneEntry(data);
View Full Code Here

    private OperationStatus getCurrentNoDups(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

             * 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

                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

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.