-
Notifications
You must be signed in to change notification settings - Fork 828
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: replace syncronization in Connection.close with compareAndSet
Statement can be synchronized during query execution, and we don't want .close() to wait for the statement completion.
- Loading branch information
Showing
2 changed files
with
23 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@vlsi : I believe this may not be consistently correct. Since synchronised has been removed from the previous updated the java memory model does not give you any guantees that this is up to date in this thread.
It would be more sensible to use the get method on the IS_CLOSED_UPDATER i.e. IS_CLOSED_UPDATER.get().
This should at least give some guarantee that the result is fresh and not cached for this thread.