Home » Java » java – Synchronize PostgreSQL procedure call through REST web service-Exceptionshub

java – Synchronize PostgreSQL procedure call through REST web service-Exceptionshub

Posted by: admin February 25, 2020 Leave a comment

Questions:

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 JSON response.

What is the correct way to synchronize the calls?

How to&Answers: