Skip to content

GH-1129: Close prepared handles on Statement reuse - #1509

Closed
xborder wants to merge 1 commit into
apache:mainfrom
xborder:codex/gh-1129-statement-handle-leak
Closed

xborder wants to merge 1 commit into
apache:mainfrom
xborder:codex/gh-1129-statement-handle-leak

Conversation

@xborder

@xborder xborder commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Repeated Statement.execute(String) calls can replace the prepared statement for the same JDBC handle. The old server-side handle can then remain open because Statement.close() only closes the replacement.

Build the replacement, close the previous prepared resources, then execute the replacement. Add a regression test that checks both server handles close.

Closes #1129.

Test plan

  • mvn -pl flight/flight-sql-jdbc-core test — 1,334 tests passed; 45 skipped
  • mvn -pl flight/flight-sql-jdbc-core spotless:check — passed
  • Checkstyle — 0 violations

Close the previous server-side handle after building a replacement for repeated Statement.execute(String) calls.
@github-actions

Copy link
Copy Markdown

Thank you for opening a pull request!

Please label the PR with one or more of:

  • bug-fix
  • chore
  • dependencies
  • documentation
  • enhancement

Also, add the 'breaking-change' label if appropriate.

See CONTRIBUTING.md for details.

@xborder xborder closed this Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FlightSQL] Statement.execute(String) can leak server prepared-statement handles when reused

1 participant