Skip to content

Commit 6fb2524

Browse files
committed
fix: close old JDBC connection before reconnecting The previous connection object was discarded with connection = null without calling close(), leaking the server-side HANA session on every reconnect. The connection is now closed (ignoring any close error) before the field is cleared.
1 parent d95cd8b commit 6fb2524

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/main/java/org/sap/cytoscape/internal/hdb/HanaConnectionManager.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ public HanaConnectionManager() throws IOException {
5353
*/
5454
public void connect(String host, String port, Properties connectionProperties) throws SQLException {
5555

56+
if (this.connection != null) {
57+
try { this.connection.close(); } catch (SQLException ignore) {}
58+
}
5659
this.connection = null;
5760

5861
try {

0 commit comments

Comments
 (0)