Package com.cloud.utils.db

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


                    VMComputeTagVO vo = new VMComputeTagVO(vmId, tag);
                    persist(vo);
                }
            }
        }
        txn.commit();
    }

    @Override
    public List<String> getComputeTags(long vmId) {
View Full Code Here


        saveComputeTags(vm.getId(), vm.getComputeTags());
        loadComputeTags(dbVO);
        saveRootDiskTags(vm.getId(), vm.getRootDiskTags());
        loadRootDiskTags(dbVO);

        txn.commit();

        return dbVO;
    }

    private void loadVmNetworks(VMEntityVO dbVO) {
View Full Code Here

            } else {
                s_logger.warn("User stats were not created for account " + router.getAccountId() + " and dc " + router.getDataCenterId());
            }
            }
           
            txn.commit();
        } catch (final Exception e) {
            txn.rollback();
            throw new CloudRuntimeException("Problem updating stats after reboot/stop ", e);
        }
    }
View Full Code Here

            if (updated) {
                Transaction txn = Transaction.open(Transaction.CLOUD_DB);
                try {
                    txn.start();
                    _routerDao.update(router.getId(), router);
                    txn.commit();
                } catch (Exception e) {
                    txn.rollback();
                    s_logger.warn("Unable to update router status for account: " + router.getAccountId());
                } finally {
                    txn.close();
View Full Code Here

        VMReservationVO dbVO = super.persist(reservation);

        saveVolumeReservation(reservation);
        loadVolumeReservation(dbVO);

        txn.commit();

        return dbVO;
    }

    private void saveVolumeReservation(VMReservationVO reservation) {
View Full Code Here

                    NicIpAliasVO ipAliasVO = _nicIpAliasDao.findByInstanceIdAndNetworkId(network.getId(), router.getId());
                    Transaction txn = Transaction.currentTxn();
                    txn.start();
                    _nicIpAliasDao.expunge(ipAliasVO.getId());
                    _ipAddressDao.unassignIpAddress(routerPublicIP.getId());
                    txn.commit();
                    throw new CloudRuntimeException("failed to configure ip alias on the router as a part of dhcp config");
                }
            }
            return true;
        }
View Full Code Here

                Transaction txn= Transaction.currentTxn();
                txn.start();
                for (NicIpAliasVO revokedAliasVO : revokedIpAliasVOs) {
                    _nicIpAliasDao.expunge(revokedAliasVO.getId());
                }
                txn.commit();
                return true;
            }
        }
        return  false;
    }
View Full Code Here

                    VMRootDiskTagVO vo = new VMRootDiskTagVO(vmId, tag);
                    persist(vo);
                }
            }
        }
        txn.commit();
    }


    @Override
    public List<String> getRootDiskTags(long vmId) {
View Full Code Here

                                //update agg bytes
                                stats.setAggBytesSent(stats.getNetBytesSent() + stats.getCurrentBytesSent());
                                stats.setAggBytesReceived(stats.getNetBytesReceived() + stats.getCurrentBytesReceived());
                            }
                            _userStatsDao.update(stats.getId(), stats);
                            txn.commit();
                        } catch (Exception e) {
                            txn.rollback();
                            s_logger.warn("Unable to update user statistics for account: " + router.getAccountId()
                                    + " Rx: " + answer.getBytesReceived() + "; Tx: " + answer.getBytesSent());
                        } finally {
View Full Code Here

        for (Long networkId : networks) {
            VMNetworkMapVO vo = new VMNetworkMapVO(vmId, networkId);
            persist(vo);
        }

        txn.commit();
    }

    @Override
    public List<Long> getNetworks(long vmId) {
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.