Skip to content

Commit

Permalink
https://issues.jboss.org/browse/JGRP-2199
Browse files Browse the repository at this point in the history
  • Loading branch information
belaban committed Jul 26, 2017
1 parent 33e25d0 commit 215cdb6
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/org/jgroups/protocols/JDBC_PING.java
Expand Up @@ -111,6 +111,14 @@ public void init() throws Exception {
}


@Override
public void stop() {
super.stop();
if(is_coord)
removeAll(cluster_name);
}


protected void write(List<PingData> list, String clustername) {
for(PingData data: list)
writeToDB(data, clustername, true);
Expand Down Expand Up @@ -377,7 +385,7 @@ protected void closeConnection(final Connection connection) {
}

protected DataSource getDataSourceFromJNDI(String name) {
final DataSource dataSource;
final DataSource data_source;
InitialContext ctx = null;
try {
ctx = new InitialContext();
Expand All @@ -386,9 +394,9 @@ protected DataSource getDataSourceFromJNDI(String name) {
throw new IllegalArgumentException("JNDI name " + name + " is not bound");
if (!(whatever instanceof DataSource))
throw new IllegalArgumentException("JNDI name " + name + " was found but is not a DataSource");
dataSource = (DataSource) whatever;
data_source = (DataSource) whatever;
log.debug("Datasource found via JNDI lookup via name: %s", name);
return dataSource;
return data_source;
} catch (NamingException e) {
throw new IllegalArgumentException("Could not lookup datasource " + name, e);
} finally {
Expand Down

0 comments on commit 215cdb6

Please sign in to comment.