Package org.photovault.dbhelper

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


            query.create( oql );
            photos = (List) query.execute();
            txw.commit();
        } catch (Exception e ) {
            log.warn( "Error fetching record: " + e.getMessage() );
            txw.abort();
            throw new PhotoNotFoundException();
        }
        PhotoInfo photo = null;
        if ( photos.size() > 0 ) {
            if ( photos.size() > 1 ) {
View Full Code Here


            }
            txw.commit();
        } catch ( Exception e ) {
            log.warn( "Error executing query: " + e.getMessage() );
            e.printStackTrace( System.out );
            txw.abort();
        }
        return photos; 
    }
   
    /**
 
View Full Code Here

                Throwable rootCause = e;
                while ( rootCause.getCause() != null ) {
                    rootCause = rootCause.getCause();
                }
                log.error( rootCause.getMessage() );
                txw.abort();
                return null;
            }
            rootFolder = (PhotoFolder) folders.get( 0 );
            PhotoFolder.rootFolder = rootFolder;
            // If a new transaction was created, commit it
View Full Code Here

            OQLQuery query = odmg.newOQLQuery();
            query.create( "select folders from " + PhotoFolder.class.getName()
                        + " where uuid = \"" + uuid.toString() + "\"" );
            folders = (List) query.execute();
        } catch ( Exception e ) {
            txw.abort();
            return null;
        }
        if ( folders.size() > 0 ) {
            f = (PhotoFolder) folders.get( 0 );
        }
View Full Code Here

            OQLQuery query = odmg.newOQLQuery();
            query.create( "select folders from " + PhotoFolder.class.getName()
                        + " where folderId = " + id );
            folders = (List) query.execute();
        } catch ( Exception e ) {
            txw.abort();
            return null;
        }
        f = (PhotoFolder) folders.get( 0 );
        // If a new transaction was created, commit it
        txw.commit();
View Full Code Here

        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 );
View Full Code Here

            } else {
                exportImage =img.getRenderedImage( 1.0, false );
            }
        } catch ( Exception e ) {
            log.warn( "Error reading image: " + e.getMessage() );
            txw.abort();
            throw new PhotovaultException( "Error reading image: " + e.getMessage(), e );
        }
               
        // Reduce to 8 bit samples if we have more...
        if ( exportImage.getSampleModel().getSampleSize( 0 ) == 16 ) {
View Full Code Here

                }
            }
           
        } catch ( IOException e ) {
            log.warn( "Error writing exported image: " + e.getMessage() );
            txw.abort();
            throw new PhotovaultException( "Error writing exported image: " + e.getMessage(), e );
        }
       
        txw.commit();
    }
View Full Code Here

            OQLQuery query = odmg.newOQLQuery();
            query.create( oql );
            photos = (List) query.execute();
            txw.commit();
        } catch (Exception e ) {
            txw.abort();
            return;
        }
       
        Iterator iter =photos.iterator();
        int photoCount = photos.size();
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.