Skip to content

Fix close idempotency for JDBC PreparedStatement#17639

Merged
highker merged 1 commit intoprestodb:masterfrom
axiomq:backport/fix_close_idempotency_for_jdbc_preparedstatement
Apr 20, 2022
Merged

Fix close idempotency for JDBC PreparedStatement#17639
highker merged 1 commit intoprestodb:masterfrom
axiomq:backport/fix_close_idempotency_for_jdbc_preparedstatement

Conversation

@branimir-vujicic
Copy link
Copy Markdown
Contributor

@branimir-vujicic branimir-vujicic commented Apr 13, 2022

Fix the behavior of PreparedStatement.close() so that it may be called
multiple times without throwing an exception on subsequent invocations,
which is required per the JDBC specification:

Calling the method close on a Statement object that
is already closed has no effect.

Cherry-pick of trinodb/trino#11620

Co-authored-by: David Phillips david@acz.org

Test plan - Added Unit Tests

== NO RELEASE NOTE ==

@highker highker requested a review from NikhilCollooru April 15, 2022 02:36
@NikhilCollooru
Copy link
Copy Markdown
Contributor

There is a style check error. No need to explicitly set isClosed = false. We can just private boolean isClosed. Sorry I didnt consider that earlier.

@NikhilCollooru NikhilCollooru requested a review from highker April 19, 2022 16:33
@highker
Copy link
Copy Markdown

highker commented Apr 19, 2022

Can we squash all commits into one? Also, can we cap the commit message upto 72 characters per line.

@highker highker self-assigned this Apr 19, 2022
Fix the behavior of PreparedStatement.close() so that it may be called
multiple times without throwing an exception on subsequent invocations,
which is required per the JDBC specification:
```
Calling the method close on a Statement object that
is already closed has no effect.
```

Cherry-pick of trinodb/trino#11620

Co-authored-by: David Phillips <david@acz.org>
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.

3 participants