Skip to content

Fix close idempotency for JDBC PreparedStatement#11620

Merged
electrum merged 2 commits intotrinodb:masterfrom
electrum:jdbc-close
Mar 23, 2022
Merged

Fix close idempotency for JDBC PreparedStatement#11620
electrum merged 2 commits intotrinodb:masterfrom
electrum:jdbc-close

Conversation

@electrum
Copy link
Copy Markdown
Member

@electrum electrum commented Mar 22, 2022

Description

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.

Documentation

(x) No documentation is needed.

Release notes

(x) Release notes entries required with the following suggested text:

# JDBC driver

* Allow `PreparedStatement.close()` to be called multiple times. ({issue}`11620`)

@cla-bot cla-bot bot added the cla-signed label Mar 22, 2022
@electrum electrum added the bug label Mar 22, 2022
@github-actions github-actions bot added the jdbc Relates to Trino JDBC driver label Mar 23, 2022
Per the JDBC specification: When a Statement object is closed,
its current ResultSet object, if one exists, is also closed.
@electrum electrum merged commit adb45f1 into trinodb:master Mar 23, 2022
@electrum electrum deleted the jdbc-close branch March 23, 2022 03:54
@github-actions github-actions bot added this to the 375 milestone Mar 23, 2022
v-jizhang added a commit to v-jizhang/presto that referenced this pull request Apr 6, 2022
Cherry-pick of trinodb/trino#11620

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.

Co-authored-by: David Phillips <david@acz.org>
highker pushed a commit to prestodb/presto that referenced this pull request Apr 20, 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

cla-signed jdbc Relates to Trino JDBC driver

Development

Successfully merging this pull request may close these issues.

2 participants