Package com.cloud.utils.db

Examples of com.cloud.utils.db.TransactionLegacy.commit()


                    Date ts = DateHelper.currentGMTTime();
                    item.setCreateTime(ts);
                    item.setLastAccessTime(ts);
                    item.setLastModifiedTime(ts);
                    item = itemDao.persist(item);
                    txn.commit();
                }
            }
        } else {
            TransactionLegacy txn1 = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
            txn1.start();
View Full Code Here


            }

            if (null != sbp)
                ServiceProvider.getInstance().setBucketPolicy(bucketName, sbp);
            response.setStatus(200);
            txn.commit();
            txn.close();
        } catch (PermissionDeniedException e) {
            logger.error("Put Bucket Policy failed due to " + e.getMessage(), e);
            throw e;
        } catch (ParseException e) {
View Full Code Here

                UserCredentialsVO user = ucDao.getByAccessKey(accessKey[0]);
                user.setCertUniqueId(null);
                ucDao.update(user.getId(), user);
                response.setStatus(200);
                endResponse(response, "User certificate deleted successfully");
                txn.commit();
            } else
                response.setStatus(404);

        } catch (NoSuchObjectException e) {
            logger.error("SetCertificate exception " + e.getMessage(), e);
View Full Code Here

            pstmt = txn.prepareAutoCloseStatement(sql);
            pstmt.setLong(1, allocatedAmount);
            pstmt.setLong(2, hostId);
            pstmt.setShort(3, capacityType);
            pstmt.executeUpdate(); // TODO:  Make sure exactly 1 row was updated?
            txn.commit();
        } catch (Exception e) {
            txn.rollback();
            s_logger.warn("Exception updating capacity for host: " + hostId, e);
        }
    }
View Full Code Here

        VolumeVO entry = findById(id);
        if (entry != null) {
            _tagsDao.removeByIdAndType(id, ResourceObjectType.Volume);
        }
        boolean result = super.remove(id);
        txn.commit();
        return result;
    }

    @Override
    @DB
View Full Code Here

            update(srcVolId, srcVol);
            update(destVolId, destVol);
        } catch (Exception e) {
            throw new CloudRuntimeException("Unable to persist the sequence number for this host");
        }
        txn.commit();
        return true;
    }

    @Override
    public ScopeType getVolumeStoragePoolScope(long volumeId) {
View Full Code Here

        SearchCriteria<VMTemplateZoneVO> sc = TemplateSearch.create();
        sc.setParameters("template_id", templateId);
        TransactionLegacy txn = TransactionLegacy.currentTxn();
        txn.start();
        remove(sc);
        txn.commit();

    }

}
View Full Code Here

        cluster.setGuid(null);

        update(id, cluster);

        boolean result = super.remove(id);
        txn.commit();
        return result;
    }

    @Override
    public boolean updateState(State currentState, Event event, State nextState, DataCenterResourceEntity clusterEntity, Object data) {
View Full Code Here

        expunge(sc);
        for (Map.Entry<String, String> detail : details.entrySet()) {
            AccountDetailVO vo = new AccountDetailVO(accountId, detail.getKey(), detail.getValue());
            persist(vo);
        }
        txn.commit();
    }

    @Override
    public AccountDetailVO findDetail(long accountId, String name) {
        QueryBuilder<AccountDetailVO> sc = QueryBuilder.create(AccountDetailVO.class);
View Full Code Here

        pod.setName(null);

        update(id, pod);

        boolean result = super.remove(id);
        txn.commit();
        return result;
    }

    @Override
    public List<Long> listDisabledPods(long zoneId) {
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.