java - Concurrency Control on my Code -


I am working on order capture and generator application. The application is working fine with concurrent users working on different orders. The problem begins when two users of different systems / locations try to work on the same sequence. For the same order how the business is affecting it, the application will generate duplicate data because two users are working together on that order.

I tried to synchronize that method, where I am generating an order, but this would mean that no other user can work on any new order because of synchronization of that method Will be locked for. This will definitely prevent all users from issuing an order, when an order is increasing, as it will affect the synchronized code.

I have also tried with the criteria incompetence for an order, but there is no success.

Can someone please suggest proper perspectives ?? All suggestions / comments are welcome Thanks in advance. Instead of synchronizing the method level, you can use block-level synchronization of the block of code.



Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -