The code here is correct. It means there's no row updated because the revision was changed. This is what optimistic locking tries to achieve.