Package com.cloud.utils.db

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


            txn.rollback();
            return null;
        }
        ip.setTakenAt(new Date());
        update(ip.getId(), ip);
        txn.commit();
        return ip;
    }

    @Override
    public void releaseIpAddress(String ip) {
View Full Code Here


        //cluster.setVsmId(null);

        update(id, cluster);

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

}
View Full Code Here

                value = DBEncryptionUtil.encrypt(value);
            }
            ClusterDetailsVO vo = new ClusterDetailsVO(clusterId, detail.getKey(), value);
            persist(vo);
        }
        txn.commit();
    }

    @Override
    public void persist(long clusterId, String name, String value) {
        TransactionLegacy txn = TransactionLegacy.currentTxn();
View Full Code Here

        sc.setParameters("name", name);
        expunge(sc);

        ClusterDetailsVO vo = new ClusterDetailsVO(clusterId, name, value);
        persist(vo);
        txn.commit();
    }

    @Override
    public Scope getScope() {
        return ConfigKey.Scope.Cluster;
View Full Code Here

                info.setCanonicalUserId(accessKey);
                info.setDescription("S3 REST request");
                return info;
            }
        } finally {
            txn.commit();
        }
    }

    @DB
    protected void initialize() {
View Full Code Here

            //SObjectItemDaoImpl itemDao = new SObjectItemDaoImpl();
            SObjectItemVO item = itemDao.findById(object_objectitem_pair.getSecond().getId());
            item.setMd5(md5Checksum);
            item.setStoredSize(contentLength);
            itemDao.update(item.getId(), item);
            txn.commit();
        } catch (IOException e) {
            logger.error("PutObjectInline failed due to " + e.getMessage(), e);
        } catch (OutOfStorageException e) {
            logger.error("PutObjectInline failed due to " + e.getMessage(), e);
        } finally {
View Full Code Here

            txn.start();
            // -> use the keys to see if the account actually exists
            ServiceProvider.getInstance().getEC2Engine().validateAccount(accessKey[0], secretKey[0]);
            UserCredentialsVO user = new UserCredentialsVO(accessKey[0], secretKey[0]);
            ucDao.persist(user);
            txn.commit();
        } catch (Exception e) {
            logger.error("SetUserKeys " + e.getMessage(), e);
            response.setStatus(401);
            endResponse(response, e.toString());
            txn.close();
View Full Code Here

            SObjectItemVO item = itemDao.findById(object_objectitem_pair.getSecond().getId());
            item.setMd5(md5Checksum);
            item.setStoredSize(contentLength);
            itemDao.update(item.getId(), item);
            txn.commit();

        } catch (OutOfStorageException e) {
            logger.error("PutObject failed due to " + e.getMessage(), e);
        } finally {
            if (is != null) {
View Full Code Here

            UserCredentialsVO user = ucDao.getByAccessKey(accessKey[0]);
            user.setCertUniqueId(uniqueId);
            ucDao.update(user.getId(), user);
            response.setStatus(200);
            endResponse(response, "User certificate set successfully");
            txn.commit();

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

                Date ts = DateHelper.currentGMTTime();
                item.setCreateTime(ts);
                item.setLastAccessTime(ts);
                item.setLastModifiedTime(ts);
                item = itemDao.persist(item);
                txn.commit();
                //session.save(item);
            } else {    // -> find an object item with a null version, can be null
                     //    if bucket started out with versioning enabled and was then suspended
                item = itemDao.getByObjectIdNullVersion(object.getId());
                if (item == null) {
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.