Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

6. Consider the following application functions and then describe appropriate co

ID: 3765050 • Letter: 6

Question

6. Consider the following application functions and then describe appropriate concurrency control implementation in Oracle accordingly. Your description should address the following items: isolation levels, locks (type, level, long duration), and exception check (deadlock, write error, etc.). The following function is an example. A customer books a seat on a flight. The application checks the number of passengers on the flight. If the flight has reached its capacity, then the transaction will fail. Answer: Using the Read Committed level, the application should write-lock the flight entry only when the customer is submitting the payment (not long-duration). With the lock, the application should then check if the flight has already reached its capacity. If true, then the transaction with the customer should be cancelled; otherwise, reservation is complete. There is no need to check for deadlock exception in this implementation.

a) A journalist retrieves an article from the database by specifying an article id. The journalist can then edit the article and then save it back to the database. Assume that an article may have multiple authors.

b) A user transfers money from account x to account y.

c) Consider the COMPANY database used in the lectures. A data entry clerk enters new employee information for a department. The application checks the number of employees in the department. If the number of employees of the department exceeds a threshold, the new employee should be rejected. Assume that this is for the largest company in the world and there are tens of thousands of clerks entering employee information simultaneously.

Explanation / Answer

a)

Isolation level: Read committed.

Lock: Exclusive lock

Exception check: write error

b)

Isolation level: Serializable

Lock: Share lock

Exception check: write error

c)

Isolation level: Read-only

Lock: Exclusive lock

Exception check: write error

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote