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

30 views
Skip to first unread message

Shane Turner

unread,
Jan 14, 2016, 1:53:17 PM1/14/16
to Axon Framework Users
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.

Thanks!
Shane

Allard Buijze

unread,
Jan 18, 2016, 4:21:44 AM1/18/16
to Axon Framework Users
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.

Cheers,

Allard

--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages