1 21 package org.apache.derby.impl.store.raw.xact; 22 23 import org.apache.derby.iapi.services.locks.LockFactory; 24 import org.apache.derby.iapi.services.locks.C_LockFactory; 25 import org.apache.derby.iapi.services.locks.Latch; 26 27 import org.apache.derby.iapi.services.sanity.SanityManager; 28 29 import org.apache.derby.iapi.store.raw.ContainerHandle; 30 import org.apache.derby.iapi.store.raw.ContainerLock; 31 import org.apache.derby.iapi.store.raw.LockingPolicy; 32 import org.apache.derby.iapi.store.raw.RecordHandle; 33 import org.apache.derby.iapi.store.raw.RowLock; 34 import org.apache.derby.iapi.store.raw.Transaction; 35 36 import org.apache.derby.iapi.error.StandardException; 37 38 39 48 public class RowLockingRR extends RowLocking3 49 { 50 51 protected RowLockingRR(LockFactory lf) 52 { 53 super(lf); 54 } 55 56 protected RowLock getReadLockType() 57 { 58 return(RowLock.RS2); 59 } 60 61 protected RowLock getUpdateLockType() 62 { 63 return(RowLock.RU2); 64 } 65 66 protected RowLock getWriteLockType() 67 { 68 return(RowLock.RX2); 69 } 70 71 84 public void unlockRecordAfterRead( 85 Transaction t, 86 ContainerHandle container_handle, 87 RecordHandle record, 88 boolean forUpdate, 89 boolean row_qualified) 90 throws StandardException 91 { 92 if (!row_qualified) 93 { 94 Object qualifier = forUpdate ? RowLock.RU2 : RowLock.RS2; 95 96 int count = 97 lf.unlock(t.getCompatibilitySpace(), t, record, qualifier); 98 99 if (SanityManager.DEBUG) 100 { 101 if (!(count == 1 || count == 0)) 103 { 104 SanityManager.THROWASSERT( 105 "count = " + count + 106 "record.getContainerId() = " + record.getContainerId()); 107 } 108 } 109 } 110 } 111 112 } 113 | Popular Tags |