Question: 2. (a) What is an HTTP Servlet and what are its main methods in Java EE? Briefly describe how servlets are used by other

2. (a) What is an HTTP Servlet and what are its main methods in Java EE? Briefly describe how servlets are

2. (a) What is an HTTP Servlet and what are its main methods in Java EE? Briefly describe how servlets are used by other Java EE technologies. (b) Let us assume that the following transactions T and U will be executed on the same server. T: balance = a.getBalance(); a.setBalance(balance + 40); U: balance = a.getBalance(); a.setBalance(balance *2); Transaction T increases the balance of account a. Transaction U doubles the balance of account a. i. Could the 'Lost Update' problem happen when the operations of these two transactions are executed in some order? If so, how could this be prevented using two-phase locking and exclusive locks? ii. Could the 'Dirty Read' problem happen when the operations of these two transactions are executed in a serially equivalent manner? If so, does that depend on when T and U commit or abort and why?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The question youve provided seems to be a multipart one related to HTTP Servlets and transactional issues in a concurrent database setting I will address each part of the question in turn a What is an ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!