Package com.cloud.utils.db

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


                pstmt.setLong(3, usage.getId());
            }
            pstmt.executeUpdate();
            txn.commit();
        } catch (Exception e) {
            txn.rollback();
            s_logger.warn("Error updating UsagePortForwardingRuleVO", e);
        } finally {
            txn.close();
        }
    }
View Full Code Here


                }

                usageRecords.add(new UsagePortForwardingRuleVO(pfId, zoneId, acctId, dId, createdDate, deletedDate));
            }
        } catch (Exception e) {
            txn.rollback();
            s_logger.warn("Error getting usage records", e);
        } finally {
            txn.close();
        }
View Full Code Here

            pstmt.setLong(4, usage.getVmId());
            pstmt.setString(5, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), usage.getCreated()));
            pstmt.executeUpdate();
            txn.commit();
        } catch (Exception e) {
            txn.rollback();
            s_logger.warn("Error updating UsageVMSnapshotVO", e);
        } finally {
            txn.close();
        }
    }
View Full Code Here

                    processDate = DateUtil.parseDateString(s_gmtTimeZone, processed);
                }
                usageRecords.add(new UsageVMSnapshotVO(vId, zoneId, acctId, dId, vmId, doId, size, createdDate, processDate));
            }
        } catch (Exception e) {
            txn.rollback();
            s_logger.warn("Error getting usage records", e);
        } finally {
            txn.close();
        }
View Full Code Here

                    processDate = DateUtil.parseDateString(s_gmtTimeZone, processed);
                }
                usageRecords.add(new UsageVMSnapshotVO(vId, zoneId, acctId, dId, vmId, doId, size, createdDate, processDate));
            }
        } catch (Exception e) {
            txn.rollback();
            s_logger.warn("Error getting usage records", e);
        } finally {
            txn.close();
        }
View Full Code Here

            try {
                txn.start();
                mockHost = _mockHostDao.persist(mockHost);
                txn.commit();
            } catch (Exception ex) {
                txn.rollback();
                s_logger.error("Error while configuring mock agent " + ex.getMessage());
                throw new CloudRuntimeException("Error configuring agent", ex);
            } finally {
                txn.close();
                txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
View Full Code Here

            } else {
                s_logger.error("Host with guid " + guid + " was not found");
                return null;
            }
        } catch (Exception ex) {
            txn.rollback();
            throw new CloudRuntimeException("Unable to get host " + guid + " due to " + ex.getMessage(), ex);
        } finally {
            txn.close();
            txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
            txn.close();
View Full Code Here

            txn.commit();
            if (host == null) {
                return null;
            }
        } catch (Exception ex) {
            txn.rollback();
            throw new CloudRuntimeException("Unable to get host " + hostGuid + " due to " + ex.getMessage(), ex);
        } finally {
            txn.close();
            txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
            txn.close();
View Full Code Here

            hostStats.setCpuUtilization(usedCpu / (host.getCpuCount() * host.getCpuSpeed()));
            hostStats.setEntityType("simulator-host");
            hostStats.setHostId(cmd.getHostId());
            return new GetHostStatsAnswer(cmd, hostStats);
        } catch (Exception ex) {
            vmtxn.rollback();
            throw new CloudRuntimeException("Unable to get Vms on host " + host.getGuid() + " due to " + ex.getMessage(), ex);
        } finally {
            vmtxn.close();
            vmtxn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
            vmtxn.close();
View Full Code Here

                    }
                    txn.commit();
                    return;
                }
            } catch (Exception ex) {
                txn.rollback();
                throw new CloudRuntimeException("Unable to get host " + guid + " due to " + ex.getMessage(), 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.