[pgjdbc/pgjdbc] 4673fd: feat: synchronize statement executions (e.g. avoid...

From: Vladimir Sitnikov <noreply(at)github(dot)com>
To: pgsql-jdbc(at)lists(dot)postgresql(dot)org
Subject: [pgjdbc/pgjdbc] 4673fd: feat: synchronize statement executions (e.g. avoid...
Date: 2022-07-27 10:38:06
Message-ID: pgjdbc/pgjdbc/push/refs/heads/master/fd31a0-736f95@github.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Branch: refs/heads/master
Home: https://github.com/pgjdbc/pgjdbc
Commit: 4673fd271c63a24b2a363149945187bad911888a
https://github.com/pgjdbc/pgjdbc/commit/4673fd271c63a24b2a363149945187bad911888a
Author: Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
Date: 2022-07-27 (Wed, 27 Jul 2022)

Changed paths:
M CHANGELOG.md
M pgjdbc/src/main/java/org/postgresql/jdbc/PgCallableStatement.java
M pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java
M pgjdbc/src/main/java/org/postgresql/jdbc/PgPreparedStatement.java
M pgjdbc/src/main/java/org/postgresql/jdbc/PgStatement.java
M pgjdbc/src/test/java/org/postgresql/test/jdbc2/StatementTest.java

Log Message:
-----------
feat: synchronize statement executions (e.g. avoid deadlock when Connection.isValid is executed from concurrent threads)

This does not bring full thread safety to the driver, however,
it should reduce the number of issues when connections and statements
are accidentally executed concurrently in several threads.

fixes #1768

Commit: 736f9598c5b32a19c645ad33f118d2c9c266e90e
https://github.com/pgjdbc/pgjdbc/commit/736f9598c5b32a19c645ad33f118d2c9c266e90e
Author: Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
Date: 2022-07-27 (Wed, 27 Jul 2022)

Changed paths:
M pgjdbc/src/main/java/org/postgresql/jdbc/PgStatement.java
M pgjdbc/src/test/java/org/postgresql/test/jdbc2/StatementTest.java

Log Message:
-----------
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.

Compare: https://github.com/pgjdbc/pgjdbc/compare/fd31a06f9c64...736f9598c5b3

Browse pgsql-jdbc by date

  From Date Subject
Next Message Sehrope Sarkuni 2022-08-01 16:46:39 [pgjdbc/pgjdbc] 739e59: Merge pull request from GHSA-r38f-c4h4-hqq2
Previous Message Dave Cramer 2022-07-25 12:35:54 [pgjdbc/pgjdbc] fd31a0: update the website content (#2578)