Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oGeQe-0007RD-Lx for pgsql-jdbc@arkaria.postgresql.org; Wed, 27 Jul 2022 10:38:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oGeQd-0005s4-G0 for pgsql-jdbc@arkaria.postgresql.org; Wed, 27 Jul 2022 10:38:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oGeQd-0005rn-73 for pgsql-jdbc@lists.postgresql.org; Wed, 27 Jul 2022 10:38:11 +0000 Received: from out-19.smtp.github.com ([192.30.252.202]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oGeQa-0000qF-Hg for pgsql-jdbc@lists.postgresql.org; Wed, 27 Jul 2022 10:38:10 +0000 Received: from github.com (hubbernetes-node-7e5965b.va3-iad.github.net [10.48.204.37]) by smtp.github.com (Postfix) with ESMTPA id B32CDE0619 for ; Wed, 27 Jul 2022 03:38:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1658918286; bh=snMJGQFQDF/1uny0AJNxgH/2CgzM5vXOWOX7nveQ/S0=; h=Date:From:To:Subject:From; b=qiVUwRgEQbDZG9kX3ktlkf+47GENISvBzcnPPr6Tv3z33HHbFNxJuitqGlbMMseLE 0G58NJWfNK29HY4ApGDiEUsHQWHqWfTECM/rkDa96IFFhQzSl/kwjSSCUJZmdeAdgB xVnGmgWV6NvuNxskZqT1ujvh3fc0EV1JwZBbIu5w= Date: Wed, 27 Jul 2022 03:38:06 -0700 From: Vladimir Sitnikov To: pgsql-jdbc@lists.postgresql.org Message-ID: Subject: [pgjdbc/pgjdbc] 4673fd: feat: synchronize statement executions (e.g. avoid... Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Approved: 58GruLoMopuc X-GitHub-Recipient-Address: pgsql-jdbc@lists.postgresql.org X-Auto-Response-Suppress: All List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Branch: refs/heads/master Home: https://github.com/pgjdbc/pgjdbc Commit: 4673fd271c63a24b2a363149945187bad911888a https://github.com/pgjdbc/pgjdbc/commit/4673fd271c63a24b2a363149945187bad911888a Author: Vladimir Sitnikov 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 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