Package com.cloud.utils.db

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


            SearchByAccessKey.done();
            SearchCriteria<UserCredentialsVO> sc = SearchByAccessKey.create();
            sc.setParameters("AccessKey", cloudAccessKey);
            return findOneBy(sc);
        } finally {
            txn.commit();
            txn.close();
        }
    }

    @Override
View Full Code Here


            txn.start();
            SearchCriteria<UserCredentialsVO> sc = SearchByCertID.create();
            sc.setParameters("CertUniqueId", certId);
            return findOneBy(sc);
        } finally {
            txn.commit();
            txn.close();
        }

    }
View Full Code Here

            pstmt.setLong(6, runid);
            pstmt.setString(7, ManagementServerHost.State.Up.toString());
            pstmt.setLong(8, id);

            pstmt.executeUpdate();
            txn.commit();
        } catch (Exception e) {
            s_logger.warn("Unexpected exception, ", e);
            throw new RuntimeException(e.getMessage(), e);
        }
    }
View Full Code Here

            ManagementServerHostVO msHost = findById(id);
            msHost.setState(ManagementServerHost.State.Down);
            super.remove(id);

            txn.commit();
            return true;
        } catch (Exception e) {
            s_logger.warn("Unexpected exception, ", e);
            throw new RuntimeException(e.getMessage(), e);
        }
View Full Code Here

            pstmt.setString(1, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), lastUpdate));
            pstmt.setLong(2, id);
            pstmt.setLong(3, runid);

            int count = pstmt.executeUpdate();
            txn.commit();

            if (count < 1) {
                throw new CloudRuntimeException("Invalid cluster session detected", new ClusterInvalidSessionException("runid " + runid + " is no longer valid"));
            }
        } catch (Exception e) {
View Full Code Here

            pstmt = txn.prepareAutoCloseStatement("update mshost set alert_count=alert_count+1 where id=? and alert_count=0");
            pstmt.setLong(1, id);

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

                update(peer.getId(), peer);
            } else {
                ManagementServerHostPeerVO peer = new ManagementServerHostPeerVO(ownerMshost, peerMshost, peerRunid, peerState);
                persist(peer);
            }
            txn.commit();
        } catch (Exception e) {
            s_logger.warn("Unexpected exception, ", e);
            txn.rollback();
        }
    }
View Full Code Here

                        S3MetaDataEntry entry = meta[i];
                        mpartMeta.setName(entry.getName());
                        mpartMeta.setValue(entry.getValue());
                        mpartMetaDao.persist(mpartMeta);
                    }
                    txn.commit();
                }
            }

            return uploadId;
        } finally {
View Full Code Here

                metaVO.setUploadID(uploadId);
                metaVO.setName(entry.getName());
                metaVO.setValue(entry.getValue());
                metaVO = mpartMetaDao.persist(metaVO);
            }
            txn.commit();
        } finally {
            txn.close();
        }
    }
View Full Code Here

                // User secret key could be encrypted
                cloudSecretKey = DBEncryptionUtil.decrypt(user.getSecretKey());
            }
            return cloudSecretKey;
        } finally {
            txn.commit();
            txn.close();
        }
    }

}
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.