Search in sources :

Example 1 with ConnectionConcierge

use of com.cloud.utils.db.ConnectionConcierge in project CloudStack-archive by CloudStack-extras.

the class SimulatorManagerImpl method configure.

@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
    try {
        Connection conn = Transaction.getStandaloneConnectionWithException();
        conn.setAutoCommit(true);
        _concierge = new ConnectionConcierge("SimulatorConnection", conn, true);
    } catch (SQLException e) {
        throw new CloudRuntimeException("Unable to get a db connection", e);
    }
    return true;
}
Also used : SQLException(java.sql.SQLException) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) Connection(java.sql.Connection) ConnectionConcierge(com.cloud.utils.db.ConnectionConcierge)

Example 2 with ConnectionConcierge

use of com.cloud.utils.db.ConnectionConcierge in project cloudstack by apache.

the class ClusterManagerImpl method getHeartbeatConnection.

private Connection getHeartbeatConnection() throws SQLException {
    if (_heartbeatConnection == null) {
        final Connection conn = TransactionLegacy.getStandaloneConnectionWithException();
        _heartbeatConnection = new ConnectionConcierge("ClusterManagerHeartbeat", conn, false);
    }
    return _heartbeatConnection.conn();
}
Also used : Connection(java.sql.Connection) ConnectionConcierge(com.cloud.utils.db.ConnectionConcierge)

Aggregations

ConnectionConcierge (com.cloud.utils.db.ConnectionConcierge)2 Connection (java.sql.Connection)2 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)1 SQLException (java.sql.SQLException)1