2. (a) What is an HTTP Servlet and what are its main methods in Java EE? Briefly describe how servlets are used by other
Posted: Fri May 20, 2022 11:57 am
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?