ARTEMIS-1806 JDBC Connection leaks
The JDBC Connection leaks on: - JDBCFileUtils::getDBFileDriver(DataSource, SQLProvider) - SharedStoreBackupActivation.FailbackChecker::run on a failed awaitLiveStatus
This commit is contained in:
parent
1118bdb65e
commit
bbb2f708dd
|
@ -44,8 +44,12 @@ class JDBCFileUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
static JDBCSequentialFileFactoryDriver getDBFileDriver(DataSource dataSource, SQLProvider provider) throws SQLException {
|
static JDBCSequentialFileFactoryDriver getDBFileDriver(DataSource dataSource, SQLProvider provider) throws SQLException {
|
||||||
JDBCSequentialFileFactoryDriver dbDriver;
|
final JDBCSequentialFileFactoryDriver dbDriver;
|
||||||
if (POSTGRESQL.equals(PropertySQLProvider.Factory.investigateDialect(dataSource.getConnection()))) {
|
final PropertySQLProvider.Factory.SQLDialect sqlDialect;
|
||||||
|
try (Connection connection = dataSource.getConnection()) {
|
||||||
|
sqlDialect = PropertySQLProvider.Factory.investigateDialect(connection);
|
||||||
|
}
|
||||||
|
if (POSTGRESQL.equals(sqlDialect)) {
|
||||||
dbDriver = new PostgresSequentialSequentialFileDriver(dataSource, provider);
|
dbDriver = new PostgresSequentialSequentialFileDriver(dataSource, provider);
|
||||||
} else {
|
} else {
|
||||||
dbDriver = new JDBCSequentialFileFactoryDriver(dataSource, provider);
|
dbDriver = new JDBCSequentialFileFactoryDriver(dataSource, provider);
|
||||||
|
|
|
@ -215,8 +215,11 @@ public final class SharedStoreBackupActivation extends Activation {
|
||||||
|
|
||||||
// ensure that the server to which we are failing back actually starts fully before we restart
|
// ensure that the server to which we are failing back actually starts fully before we restart
|
||||||
nodeManager.start();
|
nodeManager.start();
|
||||||
|
try {
|
||||||
nodeManager.awaitLiveStatus();
|
nodeManager.awaitLiveStatus();
|
||||||
|
} finally {
|
||||||
nodeManager.stop();
|
nodeManager.stop();
|
||||||
|
}
|
||||||
|
|
||||||
synchronized (failbackCheckerGuard) {
|
synchronized (failbackCheckerGuard) {
|
||||||
if (cancelFailBackChecker || !sharedStoreSlavePolicy.isRestartBackup())
|
if (cancelFailBackChecker || !sharedStoreSlavePolicy.isRestartBackup())
|
||||||
|
|
Loading…
Reference in New Issue