xborder opened a new issue, #1129:
URL: https://github.com/apache/arrow-java/issues/1129
### Describe the bug, including details regarding any error messages,
version, and platform.
When reusing the same JDBC Statement and calling execute(String) multiple
times, the Flight SQL JDBC path creates a new prepared statement on each call,
but previous prepared handles are not closed before being replaced in client
tracking state.
This means only the latest handle is guaranteed to be closed when the
statement is closed. On stateful Flight SQL servers, this can leak server-side
resources associated with older handles.
Repro
```
try (Connection connection = DriverManager.getConnection(jdbcUrl,
properties);
Statement statement = connection.createStatement()) {
for (int i = 1; i <= n; i++) {
String sql = "SELECT " + i;
boolean isResultSet = statement.execute(sql);
if (isResultSet) {
try (ResultSet rs = statement.getResultSet()) {
while (rs.next()) { /* consume */ }
}
}
}
}
```
Raised in
https://github.com/apache/arrow-java/pull/1090#discussion_r3132344585
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]