Concurrency Issues in Inventory Deduction
As a student, I expect the system to accurately reflect inventory status when borrowing resources, and avoid issues where multiple student can borrow the last available stock due to concurrency problems. Currently, when only one of an item remains in inventory, concurrent requests can lead to multiple users successfully borrowing the same item, resulting in inaccurate inventory counts.
Requirements When the library resource inventory is down to the last resource, the system must effectively handle concurrent requests to ensure that only one user can successfully borrow the item and prevent duplicate borrowing.
Acceptance Criteria
-
The system should handle all concurrent requests when there is last resource left, ensuring that each resource is borrowed by only one user. -
Other users should receive a clear notification if their concurrent borrowing request fails, indicating that the resource has already been borrowed. -
Comprehensive unit and integration testing should be conducted to verify that the issue is resolved and that the system performs reliably under high concurrency conditions.