ODMGXAWrapper txw = new ODMGXAWrapper();
ImageInstance instance = null;
try {
instance = (ImageInstance) getInstances().get(instanceNum );
} catch ( IndexOutOfBoundsException e ) {
txw.abort();
throw e;
}
txw.lock( this, Transaction.WRITE );
txw.lock( instance, Transaction.WRITE );
instances.remove( instance );