Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 1 Transactions In session A , using your own database, insert a new record to one table. That is , execute an INSERT INTO
Part Transactions
In session A using your own database, insert a new record to one table. That is execute an INSERT INTO statement with session A You need to make up the data.
Check that the item was inserted by executing a SELECT statement.
Now switch to session B and check again the content of the table with the same SELECT statement.
Do you see the record that you just inserted with session Ahint: the answer is no
Why?
Go back to session A and click the Commit the current transaction button the Checkbutton to the left of the autocommit toggle button
Go to session B and check again the content of table that you inserted into.
Do you see the record that you just inserted with session A
Why?
Part Locking
With session A write an UPDATE statement to modify an existing record. Again, you need to make up the data. My example is you need to completely rewrite this for your database:
UPDATE instructor
SET lname LIU
WHERE id ;
Check with a SELECT statement that the record is updated.
Now switch to session B write an UPDATE statement to modify this same record. For example:
UPDATE instructor
SET lname Luke
WHERE id ;
Are you able to complete the update? What happens with MySQL
Why?
Now back to session A and commit.
What happens to your session B now? Are you able to complete the update?
Why?
Making sure there is no active transactions by committing both sessions otherwise your session B is still not committed
Try again with the UPDATE statements, but this time update two different records from the same table, separately in the two sessions. For example, you may update the record with id in session A and the record with id in session B
Are you able to do this concurrently?
What does it mean? Does your transactions lock the entire table or just records?
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