I have a entity in the database that contains a version field. This is a web application so the object becomes detached. When the update is made later I am using entityManager.merge(entity).
I noticed in the SQL generated it always does a select and then an update. Furthermore, it is the select that may throw the optimistic lock exception. I know this because if I manually update the version number field, I just see the select.
Can I configured it to bypass the select and have it just attempt the update? After all, seems that is the purpose of the version field and the update can throw the optimistic lock exception as well.
|