129130131132133134135136137138139
pstmt.addBatch(); } pstmt.executeBatch(); txn.commit(); } catch (Exception ex) { txn.rollback(); s_logger.error("error saving usage_vm_disk to cloud_usage db", ex); throw new CloudRuntimeException(ex.getMessage()); } } }
6566676869707172737475
pstmt.setLong(1, accountId); pstmt.setLong(2, pfId); pstmt.executeUpdate(); txn.commit(); } catch (Exception e) { txn.rollback(); s_logger.warn("Error removing UsagePortForwardingRuleVO", e); } finally { txn.close(); } }
8687888990919293949596
pstmt.setLong(3, usage.getId()); } pstmt.executeUpdate(); txn.commit(); } catch (Exception e) { txn.rollback(); s_logger.warn("Error updating UsagePortForwardingRuleVO", e); } finally { txn.close(); } }
156157158159160161162163164165166
} 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(); }
6263646566676869707172
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(); } }
114115116117118119120121122123124
} 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(); }
167168169170171172173174175176177
135136137138139140141142143144145
if (volume == null) { return null; } return volume; } catch (Exception ex) { txn.rollback(); throw new CloudRuntimeException("Unable to find volume " + path + " on secondary " + ssUrl, ex); } finally { txn.close(); txn = Transaction.open(Transaction.CLOUD_DB); txn.close();
162163164165166167168169170171172
txn.commit(); if (primaryStorage == null) { return new PrimaryStorageDownloadAnswer("Can't find primary storage"); } } catch (Exception ex) { txn.rollback(); throw new CloudRuntimeException("Error when finding primary storagee " + cmd.getPoolUuid(), ex); } finally { txn.close(); txn = Transaction.open(Transaction.CLOUD_DB); txn.close();
183184185186187188189190191192193
try { txn.start(); _mockVolumeDao.persist(newVolume); txn.commit(); } catch (Exception ex) { txn.rollback(); throw new CloudRuntimeException("Error when saving volume " + newVolume, ex); } finally { txn.close(); txn = Transaction.open(Transaction.CLOUD_DB); txn.close();