I have a
JAX-RS REST web service that runs on a
JBoss server and the Java code executes a
PostgreSQL procedure which runs a query to fetch a value most recently entered in a table, add 1 to it and return the value.
When multiple requests are made to the web service, the query execution is not synchronous and the same value is returned in the
What is the correct way to synchronize the calls?