I noticed that Spring Data JDBC doesn't seem to implemented Optimistic Locking (something like a JPA's @Version annotation).
I was thinking on creating a @Modifying
query which considers the version field and returns boolean
to check manually if the update was successful or not. But I'm afraid this approach is limited to simple entities, not aggregates implying multiple tables.
What's the best way to implement optimistic locking for aggregates?