I'm working on entity auditing for a set of entities saved in GAE Datastore using @PrePut and @PostPut datastore callbacks.
Idea is that old entity is loaded in @PrePut using Objectify and stored to context. Than updated entity is added to context in @PostPut callback. When request is processed I generate a diff in ContainerResponseFilter and save it.
Issue: if entity is updated non transactional, entity retrieved from datastore in @PrePut callback is already updated and therefore I'm unable to get a diff.
Question: Is it possible to retrieve old entity in @PrePut datastore callback if save operation is non transactional? If not, what would be the best alternative?
All load and save operations are made using Objectify. Versions: Objectify: 5.1.5 Appengine version: 1.9.20
I would really appreciate help on this one.