Aggregate using JPA (Hibernate) always updates even if no changes

I’m using a HybridJpaRepository to load my aggregates and have noticed that even though I have made
no changes to the aggregate, Hibernate is still updating my aggregate and incrementing the version.
Hibernate generally doesn’t update unless a property has changed.

Can anyone tell me why this is? and if so is there some way to stop it.


HI Shane,

the version needs to be updated, because the Events that the aggregate sends have a sequence number. Since you don’t source your aggregate from events, but from stored state, that state must have the version number of the most recently emitted event.