Package org.globus.workspace.persistence

Examples of org.globus.workspace.persistence.WorkspaceDatabaseException


            if (rs != null && rs.next()) {
                count = rs.getInt(1);
            }

            if (count < 0) {
                throw new WorkspaceDatabaseException("no count (?)");
            }

            return count > 0;

        } catch(SQLException e) {
            throw new WorkspaceDatabaseException(e.getMessage(), e);
        } finally {
            try {
                if (rs != null) {
                    rs.close();
                }
View Full Code Here


     */
    private Connection getConnection() throws WorkspaceDatabaseException {
        try {
            return this.source.getConnection();
        } catch (SQLException e) {
            throw new WorkspaceDatabaseException(e);
        }
    }
View Full Code Here

                logger.trace("updated " + updated + " rows");
            }

        } catch(SQLException e) {
            logger.error("",e);
            throw new WorkspaceDatabaseException(e);
        } finally {
            try {
                if (pstmt != null) {
                    pstmt.close();
                }
View Full Code Here

                logger.trace(Lager.id(id) + ": inserted " + inserted + " rows");  
            }

        } catch(SQLException e) {
            logger.error("",e);
            throw new WorkspaceDatabaseException(e);
        } finally {
            try {
                if (pstmt != null) {
                    pstmt.close();
                }
View Full Code Here

            rs = pstmt.executeQuery();

            if (rs == null || !rs.next()) {
                String err = "active deployment with id " + id + " not found";
                logger.error(err);
                throw new WorkspaceDatabaseException(err);
            } else {
                uuid = rs.getString(1);
                creatorDN = rs.getString(2);
                t = rs.getLong(3);
                creationTime = Calendar.getInstance();
                creationTime.setTimeInMillis(t);
                requestedDuration = rs.getInt(4);
                CPUCores = rs.getInt(5);
                memory = rs.getInt(6);
            }

            if (this.lager.accounting) {
                logger.trace("end(): found " + Lager.id(id) +
                             ": uuid = " + uuid +
                             ", creation time = " + t +
                             ", requestedDuration = " + requestedDuration +
                             ", CPU cores = " + CPUCores +
                             ", memory = " + memory +
                             ", creator DN = " + creatorDN);
            }

            rs.close();
            rs = null;

            if (ownerDN.equals(creatorDN)) {
                if (this.lager.accounting) {
                    logger.trace(Lager.id(id) + ": creatorDN in DB matches " +
                            "destroy request");
                }
            } else {
                String err = "active deployment with id " + id + " had " +
                        "non-matching creatorDN.  Expected '" + ownerDN + "'," +
                        " stored was '" + creatorDN + "'";
                logger.error(err);
                throw new WorkspaceDatabaseException(err);
            }

            // log elapsed time

            pstmt2 = c.prepareStatement(SQL_UPDATE_END_DEPLOYMENT);
            pstmt2.setObject(1, new Long(minutesElapsed));
            pstmt2.setString(2, uuid);
           
            int updated = pstmt2.executeUpdate();

            c.commit();

            if (this.lager.accounting) {
                logger.trace(Lager.id(id) + ": updated " + updated + " rows");
            }


        } catch(SQLException e) {
            logger.error("",e);
            throw new WorkspaceDatabaseException(e);
        } finally {
            try {
                if (rs != null) {
                    rs.close();
                }
View Full Code Here

                                     boolean active)
            throws NodeExistsException, WorkspaceDatabaseException {
        try {
            this.acquireWholeManagerLock();
        } catch (ResourceRequestDeniedException e) {
            throw new WorkspaceDatabaseException(e.getMessage(), e);
        }
        try {
            return this._addNode(hostname, pool, associations, memory, active);
        } finally {
            this.releaseWholeManagerLock();
View Full Code Here

            throws NodeInUseException, NodeNotFoundException, WorkspaceDatabaseException {

        try {
            this.acquireWholeManagerLock();
        } catch (ResourceRequestDeniedException e) {
            throw new WorkspaceDatabaseException(e.getMessage(), e);
        }
        try {

            Integer availMemory = null;
            if (memory != null) {
View Full Code Here

        }

        try {
            this.acquireWholeManagerLock();
        } catch (ResourceRequestDeniedException e) {
            throw new WorkspaceDatabaseException(e.getMessage(), e);
        }
        boolean result;
        try {
            final ResourcepoolEntry entry =
                    this.db.getResourcepoolEntry(hostname);
View Full Code Here

            boolean onImage = rs.getBoolean("on_image");
            try {
                FileCopyNeed need = new FileCopyNeed(sourcePath, destPath, onImage);
                vm.addFileCopyNeed(need);
            } catch(Exception e) {
                throw new WorkspaceDatabaseException("", e);
            }
        } while(rs.next());
    }
View Full Code Here

        final Lock lock = this.lockManager.getLock(coschedid);

        try {
            lock.lockInterruptibly();
        } catch (InterruptedException e) {
            throw new WorkspaceDatabaseException(
                        new LockAcquisitionFailure(e));
        }

        try {
View Full Code Here

TOP

Related Classes of org.globus.workspace.persistence.WorkspaceDatabaseException

Copyright © 2018 www.massapicom. 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.