a) What constitutes the state of an Enterprise Java Bean (EJB)? [5 marks]
b) Describe the difference between stateless and stateful session EJBs [5 marks]
c) Briefly explain the semantics of the following JSF Managed Bean:
- Stores some state while a user is navigating in a web store and why [5 marks]
d) Let us assume that the following transactions T and U will be executed on the same server:
T: balance = b.getBalance;
b.setBalance(balance + 0.2 * balance);
a.withdraw(0.2 * balance);
U: balance = b.getBalance
b.setBalance(balance + 0.15 * balance)
c.withdraw(0.15 * balance);
Transaction T transfers an amount of money from account a to account b, while U transfers an amount of money from account c to account b.
i. Describe the terms Atomicity, Isolation, and Serial Equivalence. [10 marks]
ii. Give an example of a serially equivalent interleaving of the operations of T and U and explain why the given interleaving is serially equivalent. [10 marks]
iii. Give an example to illustrate how exclusive locks can enforce the serially equivalent execution you described above? Assume that exclusive locks can be acquired to lock access to each account separately. [10 marks]