Message-ID: From: "marcmuel (@marcmuel)" To: "pgjdbc/pgjdbc" Date: Fri, 08 Oct 2021 08:31:57 +0000 Subject: Re: [pgjdbc/pgjdbc] PR #943: fix: synchronize modification of shared calendar (#921) In-Reply-To: References: List-Id: X-GitHub-Author-Login: marcmuel X-GitHub-Comment-Id: 938451423 X-GitHub-Comment-Type: issue_comment X-GitHub-Edited-At: 2021-10-08T08:33:09Z X-GitHub-Issue: 943 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/943#issuecomment-938451423 Content-Type: text/plain; charset=utf-8 I think the better approach would be to give Pgconnection, PgPreparedStatement and PgResultSet his dedicated instance of TimestampUtil. So, you don’t have to synchronize it and there is no danger of deadlocks. It's only a little more of memory and with lazy loading unnecessary creation can be omitted. I also think this would be a great benefit to have "partial" thread safety. So, Microsoft SQL jdbc for example states: [SQLServerConnection is not thread-safe, however multiple statements created from a single connection can be processing simultaneously in concurrent threads.](https://docs.microsoft.com/en-us/sql/connect/jdbc/reference/sqlserverconnection-class?view=sql-server-ver15)