Package org.rhq.core.db.upgrade

Examples of org.rhq.core.db.upgrade.StorageNodeVersionColumnUpgrader


    private static void updateStorageNodeVersion(String connectionUrl, String username, String password,
        String storageNodeAddress, String version) throws Exception {
        Connection connection = null;
        try {
            connection = DbUtil.getConnection(connectionUrl, username, password);
            StorageNodeVersionColumnUpgrader versionColumnUpgrader = new StorageNodeVersionColumnUpgrader();
            versionColumnUpgrader.upgrade(connection, version);
            int rowsUpdated = versionColumnUpgrader.setVersionForNodeWithAddress(connection, version,
                storageNodeAddress);
            if (1 != rowsUpdated) {
                throw new IllegalStateException("Expected [1] StorageNode update but updated [" + rowsUpdated + "].");
            }
        } catch (Exception e) {
View Full Code Here


    @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
    public void createStorageNodeVersionColumnIfNeeded() {
        Connection connection = null;
        try {
            connection = dataSource.getConnection();
            StorageNodeVersionColumnUpgrader versionColumnUpgrader = new StorageNodeVersionColumnUpgrader();
            versionColumnUpgrader.upgrade(connection, RHQ_VERSION);
            versionColumnUpgrader.setVersionForAllNodes(connection, RHQ_VERSION);
        } catch (Exception e) {
            LOG.error("Could not check storage node version column", e);
        } finally {
            JDBCUtil.safeClose(connection);
        }
View Full Code Here

TOP

Related Classes of org.rhq.core.db.upgrade.StorageNodeVersionColumnUpgrader

Copyright © 2018 www.massapicom. 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.