Package com.cloud.utils.db

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


            txn.commit();
            if (storagePool == null) {
                return new CreateAnswer(cmd, "Failed to find storage pool: " + sf.getUuid());
            }
        } catch (Exception ex) {
            txn.rollback();
            throw new CloudRuntimeException("Error when finding storage " + sf.getUuid(), ex);
        } finally {
            txn.close();
            txn = Transaction.open(Transaction.CLOUD_DB);
            txn.close();
View Full Code Here


        try {
            txn.start();
            volume = _mockVolumeDao.persist(volume);
            txn.commit();
        } catch (Exception ex) {
            txn.rollback();
            throw new CloudRuntimeException("Error when saving volume " + volume, ex);
        } finally {
            txn.close();
            txn = Transaction.open(Transaction.CLOUD_DB);
            txn.close();
View Full Code Here

            }
            txn.commit();

            return new AttachVolumeAnswer(cmd, cmd.getDeviceId(), cmd.getVolumePath());
        } catch (Exception ex) {
            txn.rollback();
            throw new CloudRuntimeException("Error when attaching volume " + cmd.getVolumeName() + " to VM "
                    + cmd.getVmName(), ex);
        } finally {
            txn.close();
            txn = Transaction.open(Transaction.CLOUD_DB);
View Full Code Here

      }
     
      throw new ServerException("Unable to delete volume on filer", naf);
    }
    catch (NaException nae) {
      txn.rollback();
      s_logger.warn("Unable to delete volume on filer " , nae);
      throw new ServerException("Unable to delete volume on filer", nae);
    } catch (IOException ioe) {
      txn.rollback();
      s_logger.warn("Unable to delete volume on filer " , ioe);
View Full Code Here

    catch (NaException nae) {
      txn.rollback();
      s_logger.warn("Unable to delete volume on filer " , nae);
      throw new ServerException("Unable to delete volume on filer", nae);
    } catch (IOException ioe) {
      txn.rollback();
      s_logger.warn("Unable to delete volume on filer " , ioe);
      throw new ServerException("Unable to delete volume on filer", ioe);
    }
    finally
    {
View Full Code Here

     
      txn.commit();
    } catch (NaException nae) {
      //zapi call failed, log and throw e
      s_logger.warn("Failed to create volume on the netapp filer:", nae);
      txn.rollback();
      if(volumeCreated) {
        try {
          deleteRogueVolume(volName, s);//deletes created volume on filer
        } catch (NaException e) {
          s_logger.warn("Failed to cleanup created volume whilst rolling back on the netapp filer:", e);
View Full Code Here

        }
      }
      throw new ServerException("Unable to create volume", nae);
    } catch (IOException ioe) {
      s_logger.warn("Failed to create volume on the netapp filer:", ioe);
      txn.rollback();
      if(volumeCreated) {
        try {
          deleteRogueVolume(volName, s);//deletes created volume on filer
        } catch (NaException e) {
          s_logger.warn("Failed to cleanup created volume whilst rolling back on the netapp filer:", e);
View Full Code Here

        return result;
     
      }
      catch (NaException nae)
      {
        txn.rollback();
        throw new ServerException("Unable to create LUN", nae);
      }
      catch (IOException ioe)
      {
        txn.rollback();
View Full Code Here

        txn.rollback();
        throw new ServerException("Unable to create LUN", nae);
      }
      catch (IOException ioe)
      {
        txn.rollback();
        throw new ServerException("Unable to create LUN", ioe);
      }
      finally
      {
        if (pool != null) {
View Full Code Here

      s.invokeElem(xi1);
     
      _lunDao.remove(lun.getId());
      txn.commit();
    } catch(UnknownHostException uhe) {
      txn.rollback();
      s_logger.warn("Failed to delete lun", uhe);
      throw new ServerException("Failed to delete lun", uhe);
    } catch ( IOException ioe) {
      txn.rollback();
      s_logger.warn("Failed to delete lun", ioe);
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.