1 21 22 package org.apache.derby.impl.store.raw.data; 23 24 25 import org.apache.derby.iapi.store.raw.ContainerHandle; 26 import org.apache.derby.iapi.store.raw.ContainerLock; 27 import org.apache.derby.iapi.store.raw.Page; 28 import org.apache.derby.iapi.store.raw.LockingPolicy; 29 import org.apache.derby.iapi.store.raw.RecordHandle; 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 import org.apache.derby.iapi.store.raw.ContainerKey; 43 44 import java.util.Observable ; 45 46 49 50 public class DropOnCommit extends ContainerActionOnCommit { 51 52 protected boolean isStreamContainer = false; 53 54 57 58 public DropOnCommit(ContainerKey identity) { 59 60 super(identity); 61 } 62 63 public DropOnCommit(ContainerKey identity, boolean isStreamContainer) { 64 65 super(identity); 66 this.isStreamContainer = isStreamContainer; 67 } 68 69 74 public void update(Observable obj, Object arg) { 75 if (SanityManager.DEBUG) { 76 if (arg == null) 77 SanityManager.THROWASSERT("still on observr list " + this); 78 } 79 80 if (arg.equals(RawTransaction.COMMIT) || arg.equals(RawTransaction.ABORT)) { 81 82 RawTransaction xact = (RawTransaction) obj; 83 84 try { 85 if (this.isStreamContainer) 86 xact.dropStreamContainer(identity.getSegmentId(), identity.getContainerId()); 87 else 88 xact.dropContainer(identity); 89 } catch (StandardException se) { 90 xact.setObserverException(se); 91 } 92 93 obj.deleteObserver(this); 94 } 95 } 96 } 97 | Popular Tags |