Package com.cloud.utils.db

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


                }
            } else {
                jobResult.setJobStatus(AsyncJobResult.STATUS_FAILED);
                jobResult.setResult("job-" + jobId + " does not exist");
            }
            txt.commit();
        } catch(Exception e) {
            if (jobUuid == null) {
                s_logger.error("Unexpected exception while querying async job-" + jobId + " status: ", e);
            } else {
                s_logger.error("Unexpected exception while querying async job-" + jobId + " = [ " + jobUuid + " ] status: ", e);
View Full Code Here


        Transaction txn = Transaction.currentTxn();
        txn.start();
        _jobDao.expunge(job.getId());
        //purge corresponding sync queue item
        _queueMgr.purgeAsyncJobQueueItemId(job.getId());
        txn.commit();
    }

    private long getMsid() {
        if(_clusterMgr != null) {
            return _clusterMgr.getManagementNodeId();
View Full Code Here

            try {
                txn.start();
                List<SyncQueueItemVO> items = _queueMgr.getActiveQueueItems(msHost.getId(), true);
                cleanupPendingJobs(items);
                _jobDao.resetJobProcess(msHost.getId(), ApiErrorCode.INTERNAL_ERROR.getHttpCode(), getSerializedErrorMessage("job cancelled because of management server restart"));
                txn.commit();
            } catch(Throwable e) {
                s_logger.warn("Unexpected exception ", e);
                txn.rollback();
            } finally {
                txn.close();
View Full Code Here

                                stat.setAggIOWrite(stat.getCurrentIOWrite() + stat.getNetIOWrite());
                                _vmDiskStatsDao.update(stat.getId(), stat);
                            }
                        }
                        s_logger.debug("Successfully updated aggregate vm disk stats");
                        txn.commit();
                    } catch (Exception e){
                        txn.rollback();
                        s_logger.debug("Failed to update aggregate disk stats", e);
                    } finally {
                        scanLock.unlock();
View Full Code Here

                }

                _mshostDao.update(mshost.getId(), getCurrentRunId(), NetUtils.getHostName(), version, _clusterNodeIP, _currentServiceAdapter.getServicePort(), DateUtil.currentGMTTime());
            }

            txn.commit();

            _mshostId = mshost.getId();
            if (s_logger.isInfoEnabled()) {
                s_logger.info("Management server (host id : " + _mshostId + ") is being started at " + _clusterNodeIP + ":" + _currentServiceAdapter.getServicePort());
            }
View Full Code Here

                            _vmDiskStatsDao.update(vmDiskStat_lock.getId(), vmDiskStat_lock);
                        }
                    }
                }
                txn.commit();
            } catch (Exception e) {
                s_logger.warn("Error while collecting vm disk stats from hosts", e);
            } finally {
                txn.close();
            }
View Full Code Here

                domain.setNetworkDomain(networkDomain);
            }
        }
        _domainDao.update(domainId, domain);

        txn.commit();

        return _domainDao.findById(domainId);

    }
View Full Code Here

                        txn.rollback();
                        throw new InvalidParameterValueException(
                                "The username is not same for all hosts, please modify passwords for individual hosts.");
                    }
                }
                txn.commit();
                // if hypervisor is xenserver then we update it in
                // CitrixResourceBase
            } catch (Exception e) {
                txn.rollback();
                throw new CloudRuntimeException("Failed to update password " + e.getMessage());
View Full Code Here

        for (Map.Entry<String, String> detail : details.entrySet()) {
            VolumeDetailVO vo = new VolumeDetailVO(volumeId, detail.getKey(), detail.getValue());
            persist(vo);
        }
        txn.commit();
    }

}
View Full Code Here

            addr.setVpcId(vpcId);
        }

        _ipAddressDao.update(addr.getId(), addr);

        txn.commit();

        if (vlanUse == VlanType.VirtualNetwork) {
            _firewallMgr.addSystemFirewallRules(addr, owner);
        }
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.