Deyan Tsvetanov wrote:
Hi Adrian,
yes , my current approach is database specific. It was implemented under
pressure when I found out that ofbiz sync does not work, at least in my
setup :)
So my suggestion and idea is to implement database independent solution,
I would do it but may be in few months.
The approach suggests that we implement a triggering function in entity
engine which would allow us to do event based handling on insert /
update / delete events. So in general we say: onInsert for a specific
entity execute some java method.
Entity Engine would either do that event handling completely in it's
java code or would generate and create real database triggers, if the db
engine supports it. I don't know if there is such a feature already, I
did a very quick search in the docs and found nothing. May be
Jacques could help here ? :)
Jacques, off the topic - is there an option to call native stored
procedure in the database from entity engine ? It comes very handy
sometimes ;)
As an alternative, you could query the other servers for their
current time
and generate a set of offsets to adjust the timing.
Deyan: Yes, but the clock of the main server also could run faster or
slower and in few weeks or months would eventually get synced by NTP.
That would also cause issues. Another problem is that you insert
entities with local timestamp and synchronize them using a remote one
for comparison. So you need to calculate time diff, too much logic i
think :)
I might be wrong, but the only issue I see with servers time drifting is
when to trigger an update. I'm not an expert on entity sync, but from
what I understand, timestamps are compared to see if server B's data
changed since the last sync. So, you query server B for its current
time, calculate an offset from your time, and adjust the query's timestamp.
-Adrian