DBS-C01 • Practice Test 6
Free DBS-C01 practice test — 10 questions with explanations. Set 6. No signup required.
A database specialist is analyzing an Aurora MySQL error log and finds the above deadlock error. The application performs an update on the orders table and then updates the inventory table within the same transaction. The deadlock occurs when two concurrent transactions try to update orders and inventory in different orders. Which design change should the database specialist recommend to reduce deadlocks?
Refer to the exhibit. ``` 2024-03-15 10:23:45 UTC | aurora-db-instance-1: Aurora MySQL 2024-03-15 10:23:45 UTC | 10.0.1.5:12345 [3] [thread 1] [transaction 1234] 2024-03-15 10:23:45 UTC | ERROR: Deadlock found when trying to get lock; try restarting transaction 2024-03-15 10:23:45 UTC | at line 1: UPDATE orders SET status='shipped' WHERE order_id=1001; 2024-03-15 10:23:45 UTC | at line 2: UPDATE inventory SET quantity=quantity-1 WHERE product_id=500; ```