Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Implement a program that simulates the behavior ofImportant Note: The input sequence will be affected during the simulation for example, some commands may cause a
Implement a program that simulates the behavior ofImportant Note: The input sequence will be affected during the simulation for example, some commands may cause a transaction to be blocked wait In such cases, the simulation should keep track of all subsequent operations of this transaction, and if the transaction is resumed, these operations should be simulated.Your simulation should assign transaction timestamps using an incremental counter, based on the transactions
start order, and are integer numbers: For example, in the first example input file on left above TST TST TST because T starts first, then T then T
You should do the following steps :
Design and implement appropriate data structures to keep track of transactions transaction table and
locks lock table as well as any other needed information it is your responsibility as part of the project to determine any additional needed information
In the transaction table, you should keep relevant information about each transaction. This includes transaction id transaction timestamp, transaction state active blocked waiting aborted cancelled
committed, etc. list of items locked by the transaction, plus any other relevant information. It is part of
your work to determine and specify other relevant information needed. For blocked transactions, you
should also keep an ordered list of the operations of that transaction from the input file that are waiting
to be executed if the transaction can be resumed.
In the lock table, you should keep relevant information about each locked data item. This includes item
name, lock state read share locked, or write exclusive locked transaction id for the transaction
holding the lock for write locked or list of transaction ids for the transactions holding the lock for read
locked list of transaction ids for transactions waiting for the item to be unlocked if any plus any
other relevant information. It is part of your work to determine and specify other relevant information.
Write a program that reads the operations from an input file representing a schedule and simulates the
appropriate actions for each operation by referring to and updating the entries in the transaction table
and lock table. Your program should print a short summary of the simulation action that the program
takes to simulate each command, including information on any updates to the system tables transaction
table and lock table and if the simulation will commit or abort or block a transaction, or just allow the
operation to execute.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started