1 21 22 package org.apache.derby.impl.store.raw.data; 23 24 import org.apache.derby.iapi.store.raw.ContainerHandle; 25 import org.apache.derby.iapi.store.raw.ContainerLock; 26 import org.apache.derby.iapi.store.raw.Page; 27 import org.apache.derby.iapi.store.raw.LockingPolicy; 28 import org.apache.derby.iapi.store.raw.RecordHandle; 29 import org.apache.derby.iapi.store.raw.ContainerKey; 30 31 import org.apache.derby.iapi.store.raw.data.RawContainerHandle; 32 import org.apache.derby.iapi.store.raw.log.LogInstant; 33 import org.apache.derby.iapi.store.raw.xact.RawTransaction; 34 35 import org.apache.derby.iapi.services.locks.Lockable; 36 37 import org.apache.derby.catalog.UUID; 38 39 import org.apache.derby.iapi.error.StandardException; 40 41 import org.apache.derby.iapi.services.sanity.SanityManager; 42 43 47 48 public abstract class ContainerHandleActionOnCommit extends ContainerActionOnCommit { 49 50 public ContainerHandleActionOnCommit(ContainerKey identity) { 51 52 super(identity); 53 } 54 55 58 59 62 public void openContainerAndDoIt(RawTransaction xact) { 63 64 BaseContainerHandle handle = null; 65 try { 66 handle = (BaseContainerHandle) xact.openContainer(identity, (LockingPolicy) null, 67 ContainerHandle.MODE_FORUPDATE | ContainerHandle.MODE_NO_ACTIONS_ON_COMMIT); 68 69 if (handle != null) { 71 try { 72 doIt(handle); 73 } catch (StandardException se) { 74 xact.setObserverException(se); 75 } 76 } 77 78 } catch (StandardException se) { 79 80 if (identity.getSegmentId() != ContainerHandle.TEMPORARY_SEGMENT) 83 xact.setObserverException(se); 84 } finally { 85 if (handle != null) 86 handle.close(); 87 } 88 } 89 90 protected abstract void doIt(BaseContainerHandle handle) 91 throws StandardException; 92 } 93 | Popular Tags |