Web Applications   «Prev  Next»

Alternative Locking Methods- Exercise

Alternative locking methods for Web applications

Objective: Use two methods to minimize locking for Web applications.

Scoring

You will receive 10 points for this exercise. The exercise is auto-scored; when you have completed the exercise, click the Submit button to receive full credit.

Scenario

The objective of this exercise is to demonstrate the application of two methods to minimize locking for Web applications.
Specifications are as follows: Your database retrieves rows from a table called student. This table has four columns

Student_key
Student_name
Student_address
Student_telephone

Your Web screen can only update the student_address column of the table.
You do not want to hold Oracle locks with the FOR UPDATE clause, so you will write your application to retrieve a rows from this table without holding locks. Upon retrieval, you store the prior data values in the following columns:
:old_student_name
:old_student_address
:old_student telephone

Task

Based on the specifications described above and what you know about alternative locking methods for Web applications, create and submit an SQL statement that tests the prior values before issuing the update.

Hints

Remember that Oracle will return a non-zero error status if a row is not found. You must re-retrieve the row and compare the old values to the new values before issuing the update.