Package com.cloud.utils.db

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


      pstmt.setLong(1, accountId);
      pstmt.setLong(2, volId);
      pstmt.executeUpdate();
      txn.commit();
    } catch (Exception e) {
      txn.rollback();
      s_logger.warn("Error removing usageVolumeVO", 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 UsageVolumeVO", e);
    } finally {
        txn.close();
    }
  }
View Full Code Here

                }

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

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

                }

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

           
            changedRows = pstmt.executeUpdate();
            txn.commit();
        } catch(Exception e) {
            s_logger.warn("Unexpected exception, ", e);
            txn.rollback();
        }
       
        return changedRows;
  }
 
View Full Code Here

                persist(peer);
            }
            txn.commit();
        } catch(Exception e) {
            s_logger.warn("Unexpected exception, ", e);
            txn.rollback();
        }
    }
   
    @Override
    @DB
View Full Code Here

                if (s_logger.isDebugEnabled()) {
                    s_logger.debug("Unable to transition into Starting state due to " + e.getMessage());
                }
            } finally {
                if (result == null) {
                    txn.rollback();
                }
            }

            VMInstanceVO instance = _vmDao.findById(vmId);
            if (instance == null) {
View Full Code Here

            _capacityDao.update(capacityMemory.getId(), capacityMemory);
            txn.commit();
            return true;
        } catch (Exception e) {
            s_logger.debug("Failed to transit vm's state, due to " + e.getMessage());
            txn.rollback();
            return false;
        }
    }

    @DB
View Full Code Here

            _capacityDao.update(capacityCpu.getId(), capacityCpu);
            _capacityDao.update(capacityMem.getId(), capacityMem);
            txn.commit();
        } catch (Exception e) {
            txn.rollback();
            return;
        }
    }

    @Override
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.