1 21 22 package org.apache.derby.impl.store.raw.xact; 23 24 import org.apache.derby.iapi.services.locks.LockFactory; 25 import org.apache.derby.iapi.services.locks.C_LockFactory; 26 27 import org.apache.derby.iapi.store.raw.ContainerHandle; 28 import org.apache.derby.iapi.store.raw.ContainerLock; 29 import org.apache.derby.iapi.store.raw.Transaction; 30 31 import org.apache.derby.iapi.error.StandardException; 32 33 34 40 public class ContainerLocking3 extends NoLocking { 41 42 protected final LockFactory lf; 43 44 protected ContainerLocking3(LockFactory lf) 45 { 46 this.lf = lf; 47 } 48 49 55 public boolean lockContainer( 56 Transaction t, 57 ContainerHandle container, 58 boolean waitForLock, 59 boolean forUpdate) 60 throws StandardException 61 { 62 Object qualifier = forUpdate ? ContainerLock.CX : ContainerLock.CS; 63 64 return( 65 lf.lockObject( 66 t.getCompatibilitySpace(), t, container.getId(), qualifier, 67 waitForLock ? 68 C_LockFactory.TIMED_WAIT : C_LockFactory.NO_WAIT)); 69 } 70 71 public int getMode() { 72 return MODE_CONTAINER; 73 } 74 75 76 81 } 82 | Popular Tags |