152153154155156157158159160161162
} usageRecords.add(new UsageLoadBalancerPolicyVO(lbId, zoneId, acctId, dId, createdDate, deletedDate)); } } catch (Exception e) { txn.rollback(); s_logger.warn("Error getting usage records", e); } finally { txn.close(); }
6768697071727374757677
pstmt.setLong(4, usage.getNetworkOfferingId()); } pstmt.executeUpdate(); txn.commit(); } catch (Exception e) { txn.rollback(); s_logger.warn("Error updating UsageNetworkOfferingVO", e); } finally { txn.close(); } }
139140141142143144145146147148149
} usageRecords.add(new UsageNetworkOfferingVO(zoneId, acctId, dId, vmId, noId, nicId, isDefault, createdDate, deletedDate)); } } catch (Exception e) { txn.rollback(); s_logger.warn("Error getting usage records", e); } finally { txn.close(); }
5657585960616263646566
TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); DataCenterIpAddressVO vo = lockOneRandomRow(sc, true); if (vo == null) { txn.rollback(); return null; } vo.setTakenAt(new Date()); vo.setInstanceId(instanceId); vo.setReservationId(reservationId);
7879808182838485868788
TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); DataCenterIpAddressVO vo = lockOneRandomRow(sc, true); if (vo == null) { txn.rollback(); return null; } vo.setTakenAt(new Date()); vo.setReservationId(reservationId); update(vo.getId(), vo);
7980818283848586878889
TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); PrivateIpVO vo = lockOneRandomRow(sc, true); if (vo == null) { txn.rollback(); return null; } vo.setTakenAt(new Date()); update(vo.getId(), vo); txn.commit();
119120121122123124125126127128129
} pstmt.setLong(i++, maxEventId); pstmt.executeUpdate(); txn.commit(); } catch (Exception ex) { txn.rollback(); s_logger.error("error copying events from cloud db to usage db", ex); throw new CloudRuntimeException(ex.getMessage()); } // Copy event details from cloud db to usage db
100101102103104105106107108109110
pstmt = txn.prepareAutoCloseStatement(sql); pstmt.setLong(1, maxEventTime); pstmt.executeUpdate(); txn.commit(); } catch (Exception ex) { txn.rollback(); s_logger.error("error deleting old usage disk stats", ex); } } @Override
132133134135136137138139140141142
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()); } } }
6162636465666768697071
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(); } }