Package com.cloud.utils.db

Examples of com.cloud.utils.db.TransactionLegacy.rollback()


                }
                txn.commit();
                return new GetStorageStatsAnswer(cmd, pool.getCapacity(), totalUsed);
            }
        } catch (Exception ex) {
            txn.rollback();
            throw new CloudRuntimeException("DBException during storage stats collection for pool " + uuid, ex);
        } finally {
            txn.close();
            txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
            txn.close();
View Full Code Here


            if (storagePool == null) {
                return new ManageSnapshotAnswer(cmd, false, "Can't find the storage pooll");
            }
            txn.commit();
        } catch (Exception ex) {
            txn.rollback();
            throw new CloudRuntimeException("Unable to perform snapshot", ex);
        } finally {
            txn.close();
            txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
            txn.close();
View Full Code Here

        try {
            txn.start();
            snapshot = _mockVolumeDao.persist(snapshot);
            txn.commit();
        } catch (Exception ex) {
            txn.rollback();
            throw new CloudRuntimeException("Error when saving snapshot " + snapshot, ex);
        } finally {
            txn.close();
            txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
            txn.close();
View Full Code Here

            if (secStorage == null) {
                return new BackupSnapshotAnswer(cmd, false, "can't find sec storage" + snapshotPath, null, true);
            }
            txn.commit();
        } catch (Exception ex) {
            txn.rollback();
            throw new CloudRuntimeException("Error when backing up snapshot");
        } finally {
            txn.close();
            txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
            txn.close();
View Full Code Here

        try {
            txn.start();
            snapshot = _mockVolumeDao.persist(snapshot);
            txn.commit();
        } catch (Exception ex) {
            txn.rollback();
            throw new CloudRuntimeException("Error when backing up snapshot " + newsnapshot, ex);
        } finally {
            txn.close();
            txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
            txn.close();
View Full Code Here

            if (primary == null) {
                return new CreateVolumeFromSnapshotAnswer(cmd, false, "can't find the primary storage: " + cmd.getPrimaryStoragePoolNameLabel(), null);
            }
            txn.commit();
        } catch (Exception ex) {
            txn.rollback();
            throw new CloudRuntimeException("Error when creating volume from snapshot", ex);
        } finally {
            txn.close();
            txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
            txn.close();
View Full Code Here

        try {
            txn.start();
            _mockVolumeDao.persist(volume);
            txn.commit();
        } catch (Exception ex) {
            txn.rollback();
            throw new CloudRuntimeException("Error when creating volume from snapshot " + volume, ex);
        } finally {
            txn.close();
            txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
            txn.close();
View Full Code Here

                return new Answer(cmd, false, "can't find object to delete:" + cmd.getData().getPath());
            }
            _mockVolumeDao.remove(template.getId());
            txn.commit();
        } catch (Exception ex) {
            txn.rollback();
            throw new CloudRuntimeException("Error when deleting object");
        } finally {
            txn.close();
            txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
            txn.close();
View Full Code Here

            }

            vm = _mockVmDao.findByVmName(vmName);
            txn.commit();
        } catch (Exception ex) {
            txn.rollback();
            throw new CloudRuntimeException("Unable to start VM " + vmName, ex);
        } finally {
            txn.close();
            txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
            txn.close();
View Full Code Here

            try {
                txn.start();
                vm = _mockVmDao.persist((MockVMVO)vm);
                txn.commit();
            } catch (Exception ex) {
                txn.rollback();
                throw new CloudRuntimeException("unable to save vm to db " + vm.getName(), ex);
            } finally {
                txn.close();
                txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
                txn.close();
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.