Skip to content

Fix SEA backend prematurely closing Statement/PreparedStatement after execute()#1373

Open
vikrantpuppala wants to merge 1 commit intomainfrom
fix/sea-statement-premature-close
Open

Fix SEA backend prematurely closing Statement/PreparedStatement after execute()#1373
vikrantpuppala wants to merge 1 commit intomainfrom
fix/sea-statement-premature-close

Conversation

@vikrantpuppala
Copy link
Copy Markdown
Collaborator

Summary

  • Remove auto-close logic in DatabricksSdkClient.executeStatement() that called markAsClosed() when the SEA server returned StatementState.CLOSED
  • This was violating JDBC spec §13.1.1: Statement objects must remain open until explicitly closed by the user
  • Fixes PreparedStatement reuse across transaction boundaries and getMetaData() after execution on the SEA backend

Test plan

  • Updated testExecuteStatementWithClosedStatusDoesNotCloseStatement to verify statement remains open after CLOSED response
  • Existing testExecuteStatementWithClosedStatusAndNoParentStatement still passes
  • All DatabricksStatementTest markAsClosed tests still pass (method retained for potential future use)

NO_CHANGELOG=true

This pull request was AI-assisted by Isaac.

The SEA backend was calling markAsClosed() on the JDBC Statement when
the server returned StatementState.CLOSED, preventing PreparedStatement
reuse and blocking getMetaData() after execution. Per JDBC spec §13.1.1,
Statement objects should remain open until explicitly closed by the user.

Remove the auto-close logic from DatabricksSdkClient.executeStatement()
so that SEA behaves like the Thrift backend.

Co-authored-by: Isaac
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
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.

1 participant