| If this "optimistic locking excluded" attribute is updated, isn't it normal that version will not be checked during commit if only this "optimistic locking excluded" attribute are updated during a transaction? That's what @OptimisticLock(excluded=true) exactly should do, and it's inevitable that the transaction will continue and other attribute will be override. But if any other attributes(not optimistic locking excluded) has been updated at the same transaction, hibernate will check the version during the commit, and the version mismatched will be detected if concurrent transactions exist, which will raise OptimisticLockException accordingly. |