typischmann / retail-crm

2 stars 1 forks source link

The Interaction between Order and Inventory #38

Open typischmann opened 9 years ago

typischmann commented 9 years ago

To implement a lock on the current inventory, there are two possiblities. One is to implement it using Version annotation of JPA. The another is to implement it using select for update in database trigger.

typischmann commented 9 years ago

Usages of JPA would be better, becaust it is more flexible, maintainable and controllable. Then the question is which level of lock should we use for this problem.

One article about the control of cucurrency in JPA is here: https://blogs.oracle.com/carolmcdonald/entry/jpa_2_0_concurrency_and