I have a table with a column called "count" and I want to run a cron job that will trigger a statement that performs a SQL like this:
update summaryTable set count=4;
Note that there might be concurrent threads reading & changing the value for "count" when this cron job is triggered. The table has a version column to support Optimistic Locking.
What's an efficient way to update the count in JPA ?