Question: Write a function, named validate _ locking _ schedule that takes a list of Actions ( see below ) as its only parameter. This function
Write a function, named validatelockingschedule that takes a list of Actions see below as its only parameter. This function doesnt return anything, but instead raises exceptions if the schedule is invalid according to legality of schedules, twophased locking, and consistency of transactions Be sure to validate the actions in that order. The exception classes are already defined for you in your starter solution.
The Action class is a simple class with attributes denoting the id of the database object region the id of the transaction the action takes place in and the type of action if the action was a read, write, lock, or unlock
You can assume the action classs object and transaction attributes are strings or integers types which support equality and the type is an UPPERCASE string.
class Action:
This is the Action class. It is already in the test cases, so please don't
put it in your solution.
def initself object transaction, type:
self.object object
self.transaction transaction
assert type in READ "WRITE", "LOCK", "UNLOCK"
self.type type
def strself:
return fActionselfobjectselftransactionselftype
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
