Package com.cloud.utils.db

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


            txn.commit();

            return queueVO;
        } catch(Exception e) {
            s_logger.error("Unexpected exception: ", e);
            txn.rollback();
        }
        return null;
    }

    @Override
View Full Code Here


                    s_logger.debug("There is a pending process in sync queue(id: " + queueId + ")");
            }
            txt.commit();
        } catch(Exception e) {
            s_logger.error("Unexpected exception: ", e);
            txt.rollback();
        }

        return null;
    }
View Full Code Here

            }
            txt.commit();
            return resultList;
        } catch(Exception e) {
            s_logger.error("Unexpected exception: ", e);
            txt.rollback();
        }
        return null;
    }

    @Override
View Full Code Here

                }
            }
            txt.commit();
        } catch(Exception e) {
            s_logger.error("Unexpected exception: ", e);
            txt.rollback();
        }
    }

    @Override
    @DB
View Full Code Here

                _syncQueueDao.update(queueVO.getId(), queueVO);
            }
            txt.commit();
        } catch(Exception e) {
            s_logger.error("Unexpected exception: ", e);
            txt.rollback();
        }
    }

    @Override
    public List<SyncQueueItemVO> getActiveQueueItems(Long msid, boolean exclusive) {
View Full Code Here

                for(Long id : l) {
                    setInitialUuid(tableName, id);
                }
                txn.commit();
            } catch (SQLException e) {
                txn.rollback();
                s_logger.error("Unexpected exception ", e);
            }
        } finally {
            txn.close();
        }
View Full Code Here

            ClusterVO cluster = _clusterDao.lockRow(cmd.getId(), true);
            if (cluster == null) {
                if (s_logger.isDebugEnabled()) {
                    s_logger.debug("Cluster: " + cmd.getId() + " does not even exist.  Delete call is ignored.");
                }
                txn.rollback();
                throw new CloudRuntimeException("Cluster: " + cmd.getId() + " does not exist");
            }

            Hypervisor.HypervisorType hypervisorType = cluster.getHypervisorType();
View Full Code Here

            List<HostVO> hosts = listAllHostsInCluster(cmd.getId());
            if (hosts.size() > 0) {
                if (s_logger.isDebugEnabled()) {
                    s_logger.debug("Cluster: " + cmd.getId() + " still has hosts, can't remove");
                }
                txn.rollback();
                throw new CloudRuntimeException("Cluster: " + cmd.getId() + " cannot be removed. Cluster still has hosts");
            }

            // don't allow to remove the cluster if it has non-removed storage
            // pools
View Full Code Here

            List<StoragePoolVO> storagePools = _storagePoolDao.listPoolsByCluster(cmd.getId());
            if (storagePools.size() > 0) {
                if (s_logger.isDebugEnabled()) {
                    s_logger.debug("Cluster: " + cmd.getId() + " still has storage pools, can't remove");
                }
                txn.rollback();
                throw new CloudRuntimeException("Cluster: " + cmd.getId() + " cannot be removed. Cluster still has storage pools");
            }

            if (_clusterDao.remove(cmd.getId())) {
                _capacityDao.removeBy(null, null, null, cluster.getId(), null);
View Full Code Here

            return true;
        } catch (CloudRuntimeException e) {
            throw e;
        } catch (Throwable t) {
            s_logger.error("Unable to delete cluster: " + cmd.getId(), t);
            txn.rollback();
            return false;
        }
    }

    @Override
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.