Closed masipcat closed 3 years ago
so, should we add a trigger that ensures that incoming tid is always greater than stored one?
so, should we add a trigger that ensures that incoming tid is always greater than stored one?
I don't see why this is needed. When the object is created we set de serial
/TID
to 1
. When the object is updated we increment the serial by one and during the UPDATE
statement we check that the serial
in pg is the serial
before the increment (so we are updating the same object we read at the begining of the txn).
EDIT: the logic is here: https://github.com/plone/guillotina/blob/9223322641331997ad477254ecfa185597c5ca2e/guillotina/db/storages/pg.py#L165-L170
Coll, got it should work, I just don't remember the trick on counting updated rows, seems simple than a db trigger.
And maybe we can add a
last_txn_timestamp
so we can still track changes globally