AbhishekPathania commented on code in PR #1504:
URL: https://github.com/apache/arrow-java/pull/1504#discussion_r4697438915
##########
flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/client/ArrowFlightSqlClientHandler.java:
##########
@@ -291,22 +306,30 @@ public long executeUpdate(final String query) {
@Override
public void close() throws SQLException {
- if (catalog.isPresent()) {
+ final CallOption[] baseOptions = getOptions();
+ final CallOption[] closeSessionOptions = Arrays.copyOf(baseOptions,
baseOptions.length + 1);
+ closeSessionOptions[baseOptions.length] = CLOSE_SESSION_TIMEOUT;
+ try {
+ if (builder.ownsSession) {
+ sqlClient.closeSession(new CloseSessionRequest(), closeSessionOptions);
+ }
+ } catch (FlightRuntimeException fre) {
+ if (catalog.isEmpty() &&
NO_SESSION_STATUS_CODES.contains(fre.status().code())) {
Review Comment:
@xborder makes sense. I kept the catalog path as it was to keep the change
small, but these statuses all mean there's no session to close, catalog or not.
Happy to drop the catalog check so both work the same way.
--
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]