View Issue Details

IDProjectCategoryView StatusLast Update
0004062SymmetricDSBugpublic2022-08-08 19:31
Reporterjmueller Assigned To 
Prioritynormal 
Status resolvedResolutionfixed 
Product Version3.9.17 
Target Version3.11.4Fixed in Version3.11.4 
Summary0004062: SimpleDateFormat is incompatible with PostgreSql microsecond template
DescriptionFormatUtils uses java.text.SimpleDateFormat, which has no microsecond support. In fact FormatUtils tries to add multiple "s" patterns for milliseconds which are silently discarded.
This works fine for most DBs but fails for postgres since the DmlStatement templates use "US" which means microseconds. As a result, a postgres generated partial second ".123456" will be deserialized into 123 seconds, 456 milliseconds, extra seconds get carried over into minutes of the resulting date.
Steps To Reproduce1. Have a two node cluster where both servers are running postgres.
2. Configure a test table to have a timestamptz column. Configure NEWER_WINS and use the column as the detect expression.
3. Disconnect the network between the two nodes
4. update the first database with a timestamp, make sure it has a large partial second.
5. quickly update the same row in the second database, make sure it has a small partial second.
6. Reconnect the network
Expected: a conflict is resolved, the second update is kept.
Actual: a conflict is resolved, but the first update is kept.
Additional InformationExpected workaround was to use date_trunc to remove microsecond resolution from my data, but the PostgreSqlDmlStatement class and PostgreSqlTriggerTemplate use a "US" pattern which causes timestamps in batches to be right padded with zeros.
Tagsconflict manager, data type, dialect: postgresql

Relationships

related to 0004246 closedpmarzullo Conflict Resolution: Problem with timestamp with time zones as the USE_TIMESTAMP column 

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2019-08-07 13:41 jmueller New Issue
2019-08-09 13:53 elong Tag Attached: conflict manager
2019-08-09 13:53 elong Tag Attached: data type
2019-08-09 13:53 elong Tag Attached: dialect: postgresql
2022-08-08 19:31 emiller Status new => resolved
2022-08-08 19:31 emiller Resolution open => fixed
2022-08-08 19:31 emiller Fixed in Version => 3.11.4
2022-08-08 19:31 emiller Relationship added related to 0004246