JDBC issue - 2 ResultSets getting data via a single Connection - the date functions interact.

From: David Irving <David(dot)Irving(at)hssnet(dot)com>
To: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: JDBC issue - 2 ResultSets getting data via a single Connection - the date functions interact.
Date: 2018-03-22 11:09:58
Message-ID: DB5PR06MB146484924634EBE97B823E3AFFA90@DB5PR06MB1464.eurprd06.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,
I am not sure if this is a real bug, as one should not access 2 ResultSets from the same connection at the same time from different threads.

But that is the legacy code I am looking at.

I have 2 ResultSet getDate(...) calls taking place in different threads.
The ResultSet calls getConnection().getTimestampUtils()...

And then gets the TimestampUtils convertDate or getDateBin() type functions.
These are not synchronized, so I am getting data from 1 result set turning up in the getDate() function on the other ResultSet running in the other thread.

Not sure if this is something you would like to fix, due to the non-standard way of working, but here is the TimestampUtils.java I modified to test the code.

I added a method...
public static boolean isCrisVersion() {
return true;
}
To check I was loading a separate version of the TimestampUtils.

Dave Irving
Healthcare Software Services.

P.S The JDBC driver I was using was 42.2.2 released a few days ago.
The information contained in this message is confidential and is intended for the addressee only. If you are not the addressee, any disclosure, reproduction, copying, distribution, or other dissemination or use of this communication is strictly prohibited. Any views or opinions presented are those of the sender and do not necessarily represent the Wellbeing Software Group. Wellbeing Software Ltd is a company registered in England and Wales with company number 07925070.

Attachment Content-Type Size
TimestampUtils.java application/octet-stream 43.3 KB

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2018-03-22 13:22:29 BUG #15127: epoch lies 1 hour ahead
Previous Message PG Bug reporting form 2018-03-22 04:31:29 BUG #15126: bug report for pgAdmin 4 v2.1