You must add a column to the table if you want to use optimistic locking. Well, there is no need to add the version column to all tables for optimistic locking, if the child is accessible and modified using the entity parent, then you do not need to put the version column in the child's table.
Optimistic locking is a powerful feature of OR engines, it did not cause a loss of performance or deadlock, like a pessimistic locking of a database, so it should be preferred.
source
share