We are using Hibernate envers to store historical revisions of the data, there is a requirement to revert data to a certain revision. As we are using the Version column to use the optimistic locking approach, when I try to save data from the previous revision I get a StaleObjectException
. Is there any way to force Hibernate to store data from previous revision?
That's an awesome question. I didn't find anything like that in the envers documentation but I'm sure it's a common issue. As a workaround you could set the attributes on the desired object revision (in a constructor for instance)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With