Package com.cloud.utils.db

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


                PlannerHostReservationVO hostReservation = _plannerHostReserveDao.lockRow(id, true);
                if (hostReservation == null) {
                    if (s_logger.isDebugEnabled()) {
                        s_logger.debug("Host reservation for host: " + hostId + " does not even exist.  Release reservartion call is ignored.");
                    }
                    txn.rollback();
                    return false;
                }
                hostReservation.setResourceUsage(null);
                _plannerHostReserveDao.persist(hostReservation);
                txn.commit();
View Full Code Here


            return false;
        } catch (CloudRuntimeException e) {
            throw e;
        } catch (Throwable t) {
            s_logger.error("Unable to release host reservation for host: " + hostId, t);
            txn.rollback();
            return false;
        }
    }
}
View Full Code Here

            pzc.checkAllPodCidrSubnets();

        } catch (Exception ex) {
            System.out.print("ERROR IS"+ex);
            s_logger.error("error", ex);
            txn.rollback();
        }
    }

    private void setCurrentObjectName(String name) {
        _currentObjectName = name;
View Full Code Here

            // Create default system networks
            createDefaultSystemNetworks(zone.getId());
            txn.commit();
            return zone;
        } catch (Exception ex) {
            txn.rollback();
            s_logger.warn("Exception: ", ex);
            throw new CloudRuntimeException("Fail to create a network");
        } finally {
            txn.close();
        }
View Full Code Here

            jobForUpdate.setSuccess(success);
            update(job.getId(), jobForUpdate);

            txn.commit();
        } catch (Exception ex) {
            txn.rollback();
            s_logger.error("error updating job success date", ex);
            throw new CloudRuntimeException(ex.getMessage());
        } finally {
            txn.close();
        }
View Full Code Here

      pstmt.setLong(2, volId);
      pstmt.setInt(3, storage_type);
      pstmt.executeUpdate();
      txn.commit();
    } catch (Exception e) {
      txn.rollback();
      s_logger.warn("Error removing usageStorageVO", e);
    } finally {
        txn.close();
    }
  }
View Full Code Here

        pstmt.setInt(4, usage.getStorageType());
      }
      pstmt.executeUpdate();
      txn.commit();
    } catch (Exception e) {
      txn.rollback();
      s_logger.warn("Error updating UsageStorageVO", e);
    } finally {
        txn.close();
    }
  }
View Full Code Here

                }

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

            pstmt = txn.prepareAutoCloseStatement(sql);
            pstmt.setLong(1, maxEventTime);
            pstmt.executeUpdate();
            txn.commit();
        } catch (Exception ex) {
            txn.rollback();
            s_logger.error("error deleting old usage network stats", ex);
        }
  }

    @Override
View Full Code Here

                pstmt.addBatch();
            }
            pstmt.executeBatch();
            txn.commit();
        } catch (Exception ex) {
            txn.rollback();
            s_logger.error("error saving usage_network to cloud_usage db", ex);
            throw new CloudRuntimeException(ex.getMessage());
        }
    }
}
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.