JPA optimistic locking vs synchronized Java method
<p>Using JPA optimistic locking we can control via a @Version field if a database table has been updated by another transaction at the same time,  allowing to have reliable data stored in database.</p>

<p>If a Java application has only one CRUD service in charge of an specific entity in database, we could synchronize its methods and manage the order the information is stored in database too.</p>

<p>So my question is,  what's the difference between those scenarios? Does exist any advantage of performance or even best practices to follow? </p>