01: /*
02:
03: Derby - Class org.apache.derby.impl.store.raw.xact.NoLocking
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to you under the Apache License, Version 2.0
09: (the "License"); you may not use this file except in compliance with
10: the License. You may obtain a copy of the License at
11:
12: http://www.apache.org/licenses/LICENSE-2.0
13:
14: Unless required by applicable law or agreed to in writing, software
15: distributed under the License is distributed on an "AS IS" BASIS,
16: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: See the License for the specific language governing permissions and
18: limitations under the License.
19:
20: */
21:
22: package org.apache.derby.impl.store.raw.xact;
23:
24: import org.apache.derby.iapi.services.locks.Latch;
25:
26: import org.apache.derby.iapi.store.raw.LockingPolicy;
27: import org.apache.derby.iapi.store.raw.ContainerHandle;
28: import org.apache.derby.iapi.store.raw.RecordHandle;
29: import org.apache.derby.iapi.store.raw.Transaction;
30:
31: import org.apache.derby.iapi.error.StandardException;
32:
33: /**
34: A locking policy that implements no locking.
35:
36: @see LockingPolicy
37: */
38: class NoLocking implements LockingPolicy {
39:
40: protected NoLocking() {
41: }
42:
43: public boolean lockContainer(Transaction t,
44: ContainerHandle container, boolean waitForLock,
45: boolean forUpdate) throws StandardException {
46: return true;
47: }
48:
49: public void unlockContainer(Transaction t, ContainerHandle container) {
50: }
51:
52: public boolean lockRecordForRead(Transaction t,
53: ContainerHandle container, RecordHandle record,
54: boolean waitForLock, boolean forUpdate)
55: throws StandardException {
56: return true;
57: }
58:
59: public void lockRecordForRead(Latch latch, RecordHandle record,
60: boolean forUpdate) throws StandardException {
61: }
62:
63: public boolean zeroDurationLockRecordForWrite(Transaction t,
64: RecordHandle record, boolean lockForPreviousKey,
65: boolean waitForLock) throws StandardException {
66: return true;
67: }
68:
69: public boolean lockRecordForWrite(Transaction t,
70: RecordHandle record, boolean lockForInsert,
71: boolean waitForLock) throws StandardException {
72: return true;
73: }
74:
75: public void lockRecordForWrite(Latch latch, RecordHandle record)
76: throws StandardException {
77: }
78:
79: public void unlockRecordAfterRead(Transaction t,
80: ContainerHandle container, RecordHandle record,
81: boolean forUpdate, boolean row_qualified)
82: throws StandardException {
83: }
84:
85: public int getMode() {
86: return LockingPolicy.MODE_NONE;
87: }
88:
89: }
|