Question

In: Computer Science

Question 4 Read the following scenario and address the following issues that are related to transaction...

Question 4

Read the following scenario and address the following issues that are related to transaction and concurrency control. Assume that objects a1, a2, and a3 are managed by a server, which provides two operations to operate the objects. read(a): returns the value of object a write(a, v): assigns the value v to object a Assume that the following two concurrent transactions T and U are performed on these objects.

T: read(a2); read(a1); write(a2, a2-25); read(a3); write(a1, a1+52)

U: read(a3); read(a2); write(a2, a2+33); write(a3, a3-26)

Assume that the original values of a1, a2, and a3 are 111, 106 and 125 respectively. Answer the following questions based on the above scenario.

1. If there is no concurrency control, transactions T and U may perform the following interleaving operations on objects a1, a2 and a3. What problem can be caused by the operations? Justify your answer.

T: read(a2); U: read(a3); U: read(a2); T: read(a1); T: write(a2, a2-25); T: read (a3); U: write(a2, a2+33); T: write(a1, a1+52); U: write(a3, a3-26)

2. What requirement must be satisfied in order to avoid the problem?

3. When the above requirement in question (1) is satisfied, what would be the correct values of a1, a2 and a3 after T and U commit?

4. Give an example of possible interleaving operations that can produce the correct values of a1, a2 and a3.

Solutions

Expert Solution

1.). Interleaving operations of two transactions dependent on the same subject may be problematic for the integrity of the solution. In both the transaction T and U, there are read-write and write-write dependency existing which can result in erroneous read and write operations being performed by transactions t or u and may lead to inconsistent result.

2.). In order to avoid this problem the operations of transaction T and U must be serialised such that the transaction are performed in serial order as required. Conflict equivalent transactions is needed to be derived for such serial transactions.

The final value of A1 A2 and A3 after t and u commit it is 163 114 and 99 respectively as explained in the solution in the picture.


Related Solutions

create a scenario for 3 separate transactions that address the following issues as accounting journal entries...
create a scenario for 3 separate transactions that address the following issues as accounting journal entries Issue stock at an amount above par value Declare property dividend, using an existing asset which has increased in value. Repurchase shares to hold in Treasury and then reissue a portion of the shares for a different price.
Assessment Part 1: Read the scenario and address all of the checklist items. Scenario: A new...
Assessment Part 1: Read the scenario and address all of the checklist items. Scenario: A new product manager presents to you, the Chief Financial Officer, a proposal to expand operations that includes the purchase of a new machine. The product manager is certain that the positive cash flows, which exceed the initial outlay by $20,000 by the end of year 4, will bring both praise and approval. You explain the company uses a 12% discount rate for cash flows and...
Read the following research and summarize and answer the questions Ethical issues related to caring for...
Read the following research and summarize and answer the questions Ethical issues related to caring for low birth weight infants Abstract Background: Currently preterm births are the leading causes of newborn deaths and newborn mortality in developed countries. Infants born prematurely remain vulnerable to many acute complications and long-term disabilities. There is a growing concern surrounding the moral and ethical implications of the complex and technological care being provided to extremely low birth weight infants in neonatal intensive care units...
Read the scenario below, and address the subsequent requirements. Emma is the plant manager of an...
Read the scenario below, and address the subsequent requirements. Emma is the plant manager of an electronics company. Plant managers are paid a salary and get an additional bonus equal to 5% of their base salary if their division meets or exceeds target profits for the year. The bonus is determined after the company’s annual financial report has been prepared and issued to shareholders. Emma’s division uses a process costing system where the estimate of the percentage completion of ending...
Please read the following scenario and respond to the question below in the form of essay...
Please read the following scenario and respond to the question below in the form of essay Claudia, a​ CMA, is working with Mr. Harrington in the examination room. Mr. Harrington is 73 years old and does not have any living immediate family members. His closest relative is a cousin who lives more than five hours away. Within the medical​practice, Mr. Harrington has the reputation of being grouchy at times and has been known to lose his temper easily. Claudia is...
Read the following scenario and answer the question in 5–10 sentences. In December of 2004, the...
Read the following scenario and answer the question in 5–10 sentences. In December of 2004, the company you own entered into a 20-year contract with a grain supplier for daily deliveries of grain to its hot dog bun manufacturing facility. The contract called for "10,000 pounds of grain" to be delivered to the facility at the price of $100,000 per day. Until February 2017, the supplier provided processed grain which could easily be used in your manufacturing process. However, no...
Read the following scenario, and answer the question as completely as possible. A driver accidentally backs...
Read the following scenario, and answer the question as completely as possible. A driver accidentally backs his car into a man's leg above the knee. The man falls to the ground, yelling in pain; he then becomes confused, and has cool, clammy, and pale skin. What should you do?
Read the following scenario and answer the question in 5–10 sentences. You are the manager of...
Read the following scenario and answer the question in 5–10 sentences. You are the manager of a medium-sized paper sales company. The paper market has been stagnant for the last several years. Therefore, you are analyzing the possible restructuring of your current staff to help improve efficiency and the quality of your services. Specifically, the supplier purchases team needs a fresh evaluation. Currently, Keeler Pansing is a rising star, known for her keen eye for determining the superiority of paper...
Question Two Read the scenario and answer the following questions. Heather Williams is the manger and...
Question Two Read the scenario and answer the following questions. Heather Williams is the manger and owner of Perfect Beauty Hair & Cosmetics located on High Street. She has been an entrepreneur for the past five years and has learnt a great deal about human behavior. Some of her stylists are self- motivated. However. There are a few that are lazy and need constant supervision to perform their duties responsibly. There are also a few technicians who create conflict and...
Read the following scenario and answer the question in 5-10 sentences. You are the CEO of...
Read the following scenario and answer the question in 5-10 sentences. You are the CEO of a small company that sells transportation and logistics software. Your company has not been doing well because of competition from larger rivals. You learn of a lucrative opportunity to sell licenses of your software to the Lackria Department of Transportation, a government agency of the nation of Lackria. Closing the deal could save your company from bankruptcy. In an impulsive moment, you meet with...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT