Package org.photovault.dbhelper

Examples of org.photovault.dbhelper.ODMGXAWrapper.lock()


        return uuid;
    }   
   
    public void setUUID( UUID uuid ) {
        ODMGXAWrapper txw = new ODMGXAWrapper();
  txw.lock( this, Transaction.WRITE );
  this.uuid = uuid;
  modified();
  txw.commit();
    }
   
View Full Code Here


        PhotoFolder folder = new PhotoFolder();
        try {
            folder.uuid = uuid;
            folder.name = "";
            folder.setParentFolder( parent );
            txw.lock( folder, Transaction.WRITE );
        } catch (IllegalArgumentException e ) {
            throw e;
        } finally {
            txw.commit();
        }
View Full Code Here

    /**
     Returns the uid of the object
     */
    public int getUid() {
        ODMGXAWrapper txw = new ODMGXAWrapper();
        txw.lock( this, Transaction.READ );
        txw.commit();
        return uid;
    }
   
    /**
 
View Full Code Here

     Adds a new image instance for this photo
     @param i The new instance
     */
    public void addInstance( ImageInstance i ) {
        ODMGXAWrapper txw = new ODMGXAWrapper();
        txw.lock( this, Transaction.WRITE );
        txw.lock( i, Transaction.WRITE );
        instances.add( i );
        i.setPhotoUiduid );
        if ( i.getInstanceType() == ImageInstance.INSTANCE_TYPE_ORIGINAL ) {
            origInstanceHash = i.getHash();
View Full Code Here

     @param i The new instance
     */
    public void addInstance( ImageInstance i ) {
        ODMGXAWrapper txw = new ODMGXAWrapper();
        txw.lock( this, Transaction.WRITE );
        txw.lock( i, Transaction.WRITE );
        instances.add( i );
        i.setPhotoUiduid );
        if ( i.getInstanceType() == ImageInstance.INSTANCE_TYPE_ORIGINAL ) {
            origInstanceHash = i.getHash();
        }
View Full Code Here

     @return The new instance
     @see ImageInstance class documentation for details.
     */
    public ImageInstance addInstance( VolumeBase volume, File instanceFile, int instanceType ) {
        ODMGXAWrapper txw = new ODMGXAWrapper();
        txw.lock( this, Transaction.WRITE );
        // Vector origInstances = getInstances();
        ImageInstance instance = ImageInstance.create( volume, instanceFile, this, instanceType );
        instances.add( instance );
       
        // If this is the first instance or we are adding original image we need to invalidate
View Full Code Here

            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 );
        instance.delete();
        txw.commit();
    }
View Full Code Here

        } catch ( IndexOutOfBoundsException e ) {
            txw.abort();
            throw e;
        }
        txw.lock( this, Transaction.WRITE );
        txw.lock( instance, Transaction.WRITE );
        instances.remove( instance );
        instance.delete();
        txw.commit();
    }
   
View Full Code Here

        log.debug( "Deleting " + purgeList.size() + " instances" );
        Iterator iter = purgeList.iterator();
        while ( iter.hasNext() ) {
            ImageInstance i = (ImageInstance) iter.next();
            ODMGXAWrapper txw = new ODMGXAWrapper();
            txw.lock( this, Transaction.WRITE );
            txw.lock( i, Transaction.WRITE );
            instances.remove( i );
            i.delete();
            txw.commit();
        }
View Full Code Here

        Iterator iter = purgeList.iterator();
        while ( iter.hasNext() ) {
            ImageInstance i = (ImageInstance) iter.next();
            ODMGXAWrapper txw = new ODMGXAWrapper();
            txw.lock( this, Transaction.WRITE );
            txw.lock( i, Transaction.WRITE );
            instances.remove( i );
            i.delete();
            txw.commit();
        }
        log.debug( "exit: purgeInvalidInstances" );       
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.