Berkeley DB
version 4.4.2

com.sleepycat.db
Class LockMode

java.lang.Object
  extended bycom.sleepycat.db.LockMode

public final class LockMode
extends Object

Locking modes for database operations. Locking modes are required parameters for operations that retrieve data or modify the database.


Field Summary
static LockMode DEFAULT
          Acquire read locks for read operations and write locks for write operations.
static LockMode DEGREE_2
          Degree 2 isolation provides for cursor stability but not repeatable reads.
static LockMode DIRTY_READ
          Read modified but not yet committed data.
static LockMode RMW
          Acquire write locks instead of read locks when doing the retrieval.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final LockMode DEFAULT
Acquire read locks for read operations and write locks for write operations.


RMW

public static final LockMode RMW
Acquire write locks instead of read locks when doing the retrieval. Setting this flag can eliminate deadlock during a read-modify-write cycle by acquiring the write lock during the read part of the cycle so that another thread of control acquiring a read lock for the same item, in its own read-modify-write cycle, will not result in deadlock.


DIRTY_READ

public static final LockMode DIRTY_READ
Read modified but not yet committed data.


DEGREE_2

public static final LockMode DEGREE_2
Degree 2 isolation provides for cursor stability but not repeatable reads. Data items which have been previously read by this transaction may be deleted or modified by other transactions before the cursor is closed or the transaction completes.

Note that this LockMode may only be passed to Database get methods, not to Cursor methods. To configure a cursor for degree 2 isolation, use CursorConfig.setDegree2(boolean).


Berkeley DB
version 4.4.2

Copyright (c) 1996-2005 Sleepycat Software, Inc. - All rights reserved.