ofbiz-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Crum <adri...@hlmksw.com>
Subject Re: ofbiz entity sync.
Date Tue, 06 Apr 2010 18:11:23 GMT
Deyan Tsvetanov wrote:
> Here is an example: 
> On server A ( the one that pushes data ) we insert the following records
> with the following sequence and timestamps: 
> 
> PARTY : party_id: 1000 , created_timestamp_tx : 6-APR -2010
> 20:00:00.010    
> PARTY_GROUP : party_group_id : 1000 ( FK to PARTY.party_id ) ,
> created_timestamp_tx: 6-APR-2010 20:00:00:013  - three  milliseconds
> later. 
> 
> That would the the database contents without issues. 
> Now imagine we do a NTP time synchronization between the two inserts.
> The NTP sync "corrects" the system clock 5 ms back. The database
> contents now would be: 
> 
> PARTY : party_id: 1000 , created_timestamp_tx : 6-APR -2010
> 20:00:00.010    
> PARTY_GROUP : party_group_id : 1000 ( FK to PARTY.party_id ) ,
> created_timestamp_tx: 6-APR-2010 20:00:00:008  - earlier than the PARTY
> record. 
> 
> When the server queries the records to be sent for synchronization the
> result will be: 
> 
> PARTY_GROUP : party_group_id : 1000 ( FK to PARTY.party_id ) ,
> created_timestamp_tx: 6-APR-2010 20:00:00:008 
> PARTY : party_id: 1000 , created_timestamp_tx : 6-APR -2010
> 20:00:00.010    
> 
> The server that accepts the push sync will try to insert first the
> PARTY_GROUP record and will get a FK constraint error - the PARTY record
> is missing. 

Okay, that's a different problem than the one I was imagining.

Mime
View raw message