Top Description Constructors Methods
org.apache.derby.impl.store.raw.xact

pack-priv Class NoLocking

extends Object
implements LockingPolicy
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.store.raw.LockingPolicy
Known Direct Subclasses
org.apache.derby.impl.store.raw.xact.RowLocking3, org.apache.derby.impl.store.raw.xact.ContainerLocking2, org.apache.derby.impl.store.raw.xact.ContainerLocking3
Imports
org.apache.derby.iapi.store.raw.LockingPolicy, .ContainerHandle, .RecordHandle, .Transaction, org.apache.derby.shared.common.error.StandardException

A locking policy that implements no locking.
See Also
LockingPolicy

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public int
getMode()

Implements org.apache.derby.iapi.store.raw.LockingPolicy.getMode.

Get the mode of this policy

public boolean
lockContainer(Transaction
Transaction to associate lock with.
t
,
ContainerHandle
Container to lock.
container
,
boolean
Should lock request wait until granted?
waitForLock
,
boolean
Should container be locked for update, or read?
forUpdate
)

Implements org.apache.derby.iapi.store.raw.LockingPolicy.lockContainer.

Called when a container is opened.

public boolean
lockRecordForRead(Transaction
Transaction to associate lock with.
t
,
ContainerHandle
Open Container used to get record. Will be used to row locks by the container they belong to.
container
,
RecordHandle
Record to lock.
record
,
boolean
Should lock request wait until granted?
waitForLock
,
boolean
Should container be locked for update, or read?
forUpdate
)

Implements org.apache.derby.iapi.store.raw.LockingPolicy.lockRecordForRead.

Called before a record is fetched.

public boolean
lockRecordForWrite(Transaction
Transaction to associate lock with.
t
,
RecordHandle
Record to lock.
record
,
boolean
Lock is for an insert.
lockForInsert
,
boolean
Should lock request wait until granted?
waitForLock
)

Implements org.apache.derby.iapi.store.raw.LockingPolicy.lockRecordForWrite.

Called before a record is inserted, updated or deleted.

public void
public void
unlockRecordAfterRead(Transaction t, ContainerHandle container, RecordHandle record, boolean forUpdate, boolean row_qualified)

Implements org.apache.derby.iapi.store.raw.LockingPolicy.unlockRecordAfterRead.

Called after a record has been fetched.

public boolean
zeroDurationLockRecordForWrite(Transaction
Transaction to associate lock with.
t
,
RecordHandle
Record to lock.
record
,
boolean
Lock is for a previous key of a insert.
lockForPreviousKey
,
boolean
Should lock request wait until granted?
waitForLock
)

Implements org.apache.derby.iapi.store.raw.LockingPolicy.zeroDurationLockRecordForWrite.

Request a write lock which will be released immediately upon grant.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NoLockingback to summary
protected NoLocking()

Method Detail

getModeback to summary
public int getMode()

Implements org.apache.derby.iapi.store.raw.LockingPolicy.getMode.

Doc from org.apache.derby.iapi.store.raw.LockingPolicy.getMode.

Get the mode of this policy

lockContainerback to summary
public boolean lockContainer(Transaction t, ContainerHandle container, boolean waitForLock, boolean forUpdate) throws StandardException

Implements org.apache.derby.iapi.store.raw.LockingPolicy.lockContainer.

Doc from org.apache.derby.iapi.store.raw.LockingPolicy.lockContainer.

Called when a container is opened.

Parameters
t:Transaction

Transaction to associate lock with.

container:ContainerHandle

Container to lock.

waitForLock:boolean

Should lock request wait until granted?

forUpdate:boolean

Should container be locked for update, or read?

Returns:boolean

true if the lock was obtained, false if it wasn't. False should only be returned if the waitForLock policy was set to "false," and the lock was unavailable.

Exceptions
StandardException:
Standard Derby error policy
lockRecordForReadback to summary
public boolean lockRecordForRead(Transaction t, ContainerHandle container, RecordHandle record, boolean waitForLock, boolean forUpdate) throws StandardException

Implements org.apache.derby.iapi.store.raw.LockingPolicy.lockRecordForRead.

Doc from org.apache.derby.iapi.store.raw.LockingPolicy.lockRecordForRead.

Called before a record is fetched.

Parameters
t:Transaction

Transaction to associate lock with.

container:ContainerHandle

Open Container used to get record. Will be used to row locks by the container they belong to.

record:RecordHandle

Record to lock.

waitForLock:boolean

Should lock request wait until granted?

forUpdate:boolean

Should container be locked for update, or read?

Exceptions
StandardException:
Standard Derby error policy
lockRecordForWriteback to summary
public boolean lockRecordForWrite(Transaction t, RecordHandle record, boolean lockForInsert, boolean waitForLock) throws StandardException

Implements org.apache.derby.iapi.store.raw.LockingPolicy.lockRecordForWrite.

Doc from org.apache.derby.iapi.store.raw.LockingPolicy.lockRecordForWrite.

Called before a record is inserted, updated or deleted. If zeroDuration is true then lock is released immediately after it has been granted.

Parameters
t:Transaction

Transaction to associate lock with.

record:RecordHandle

Record to lock.

lockForInsert:boolean

Lock is for an insert.

waitForLock:boolean

Should lock request wait until granted?

Returns:boolean

true if the lock was obtained, false if it wasn't. False should only be returned if the waitForLock argument was set to "false," and the lock was unavailable.

Exceptions
StandardException:
Standard Derby error policy
unlockContainerback to summary
public void unlockContainer(Transaction t, ContainerHandle container)

Implements org.apache.derby.iapi.store.raw.LockingPolicy.unlockContainer.

Doc from org.apache.derby.iapi.store.raw.LockingPolicy.unlockContainer.

Called when a container is closed.

unlockRecordAfterReadback to summary
public void unlockRecordAfterRead(Transaction t, ContainerHandle container, RecordHandle record, boolean forUpdate, boolean row_qualified) throws StandardException

Implements org.apache.derby.iapi.store.raw.LockingPolicy.unlockRecordAfterRead.

Doc from org.apache.derby.iapi.store.raw.LockingPolicy.unlockRecordAfterRead.

Called after a record has been fetched.

Exceptions
StandardException:
Standard Derby error policy
zeroDurationLockRecordForWriteback to summary
public boolean zeroDurationLockRecordForWrite(Transaction t, RecordHandle record, boolean lockForPreviousKey, boolean waitForLock) throws StandardException

Implements org.apache.derby.iapi.store.raw.LockingPolicy.zeroDurationLockRecordForWrite.

Doc from org.apache.derby.iapi.store.raw.LockingPolicy.zeroDurationLockRecordForWrite.

Request a write lock which will be released immediately upon grant.

Parameters
t:Transaction

Transaction to associate lock with.

record:RecordHandle

Record to lock.

lockForPreviousKey:boolean

Lock is for a previous key of a insert.

waitForLock:boolean

Should lock request wait until granted?

Returns:boolean

true if the lock was obtained, false if it wasn't. False should only be returned if the waitForLock argument was set to "false," and the lock was unavailable.

Exceptions
StandardException:
Standard Derby error policy