Package com.cloud.utils.db

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


                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());
        }
    }
}
View Full Code Here


      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();
    }
  }
View Full Code Here

        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

                }
                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

                }
                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

            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();
View Full Code Here

            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();
View Full Code Here

        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();
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.