Answer the question
In order to leave comments, you need to log in
Why does the data received from PostgreSQL break?
Welcome all.
I have exhausted my ability to find a solution to the problem and I beg you to help :)
There is a project that has been truncated to the minimum configuration that allows you to reproduce the bug: https://github.com/TerminusMKB/moidelishki
The project has one single controller that, when requested, requests and returns data about the same user in the database. At the first request to itself, it returns the correct data:
{"id":2,"testArray":"{1,2,3}","testTimestamp":"2016-01-01 00:00:00+03"}
{"id":2,"testArray":"{\"1\",\"2\",\"3\"}","testTimestamp":"2016-01-01 00:00:00+03"}
Answer the question
In order to leave comments, you need to log in
The sniffer (Wireshark) showed the following:
1) With jdbc 9.4-1201-jdbc41, one request is sent each time. And every time a complete correct answer comes from the database.
The request in the sniffer dump looks like this:
Type: Parse
Length: 169
Statement:
Query: select user0_."id" as id1_0_, user0_."testArray" as testArra2_0_, user0_."testTimestamp" as testTime3_0_ from "public"."users" user0_ where user0_."id" in (2)
Parameters: 0
Type: Parse
Length: 169
Statement: S_2
Query: select user0_."id" as id1_0_, user0_."testArray" as testArra2_0_, user0_."testTimestamp" as testTime3_0_ from "public"."users" user0_ where user0_."id" in (2)
Parameters: 0
Type: Bind
Length: 21
Portal:
Statement: S_2
Parameter formats: 0
Parameter values: 0
Result formats: 3
Format: Binary (1)
Format: Binary (1)
Format: Binary (1)
Type: Execute
Length: 9
Portal:
Returns: all rows
Type: Sync
Length: 4
1) Try throwing away the lombok, suddenly the problem is in it and the hell knows how he hung the getter / setter there.
2) Try to look at the traffic between Java and the database with a sniffer. Are the request and response exactly the same each time?
2.1) If the problem is with the fact that such a broken answer arrives from the database, then dig in the direction of the problem with the database.
2.2) If a request from Java arrives at a certain moment of the curve, then dig further into Java itself.
Congratulations. This is a JDBC bug and ARRAY deserialization, it was the same thing at one time, but for a long time.
At first I solved it with a crutch, then I updated the driver to 9.4.1210. Now everything seems to be normal.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question