When optimistic locking is enabled in Hibernate, Hibernate throws a runtime exception (HibernateOptimisticLockingFailureException).
When this exception is thrown we need to catch this exception and display a meaningful message to the user. (ex. "The object is modified by someone else.")
What I am thinking to do is catching this Runtime Exception in the service level and rethrow a custom checked exception like ConcurrentObjectModificationException.
Is this the correct approch to handle this?