Package com.cloud.utils.db

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


        context.setKeyName(nameKey);
        context.setEvalParam(ConditionKeys.Acl, cannedAccessPolicy);

        verifyAccess(context, "SBucket", bucket.getId(), SAcl.PERMISSION_WRITE)// TODO - check this validates plain POSTs
        TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
        txn.start();

        // [B] If versioning is off them we over write a null object item
        SObjectVO object = objectDao.getByNameKey(bucket, nameKey);
        if (object != null) {
            // -> if versioning is on create new object items
View Full Code Here


                    txn.commit();
                }
            }
        } else {
            TransactionLegacy txn1 = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
            txn1.start();
            // -> there is no object nor an object item
            object = new SObjectVO();
            object.setBucket(bucket);
            object.setNameKey(nameKey);
            object.setNextSequence(2);
View Full Code Here

    public void updateAllocated(Long hostId, long allocatedAmount, short capacityType, boolean add) {
        TransactionLegacy txn = TransactionLegacy.currentTxn();
        PreparedStatement pstmt = null;
        try {
            txn.start();
            String sql = null;
            if (add) {
                sql = ADD_ALLOCATED_SQL;
            } else {
                sql = SUBTRACT_ALLOCATED_SQL;
View Full Code Here

    @Override
    @DB
    public boolean remove(Long id) {
        TransactionLegacy txn = TransactionLegacy.currentTxn();
        txn.start();
        VolumeVO entry = findById(id);
        if (entry != null) {
            _tagsDao.removeByIdAndType(id, ResourceObjectType.Volume);
        }
        boolean result = super.remove(id);
View Full Code Here

    @Override
    @DB
    public boolean updateUuid(long srcVolId, long destVolId) {
        TransactionLegacy txn = TransactionLegacy.currentTxn();
        txn.start();
        try {
            VolumeVO srcVol = findById(srcVolId);
            VolumeVO destVol = findById(destVolId);
            String uuid = srcVol.getUuid();
            srcVol.setUuid(null);
View Full Code Here

    @Override
    public void deletePrimaryRecordsForTemplate(long templateId) {
        SearchCriteria<VMTemplateZoneVO> sc = TemplateSearch.create();
        sc.setParameters("template_id", templateId);
        TransactionLegacy txn = TransactionLegacy.currentTxn();
        txn.start();
        remove(sc);
        txn.commit();

    }
View Full Code Here

    }

    @Override
    public boolean remove(Long id) {
        TransactionLegacy txn = TransactionLegacy.currentTxn();
        txn.start();
        EngineClusterVO cluster = createForUpdate();
        cluster.setName(null);
        cluster.setGuid(null);

        update(id, cluster);
View Full Code Here

    }

    @Override
    public void persist(long accountId, Map<String, String> details) {
        TransactionLegacy txn = TransactionLegacy.currentTxn();
        txn.start();
        SearchCriteria<AccountDetailVO> sc = accountSearch.create();
        sc.setParameters("accountId", accountId);
        expunge(sc);
        for (Map.Entry<String, String> detail : details.entrySet()) {
            AccountDetailVO vo = new AccountDetailVO(accountId, detail.getKey(), detail.getValue());
View Full Code Here

    }

    @Override
    public boolean remove(Long id) {
        TransactionLegacy txn = TransactionLegacy.currentTxn();
        txn.start();
        EngineHostPodVO pod = createForUpdate();
        pod.setName(null);

        update(id, pod);
View Full Code Here

    @Override
    @DB
    public boolean update(Long zoneId, EngineDataCenterVO zone) {
        TransactionLegacy txn = TransactionLegacy.currentTxn();
        txn.start();
        boolean persisted = super.update(zoneId, zone);
        if (!persisted) {
            return persisted;
        }
        saveDetails(zone);
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.