This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
using ejb's when we performing the operations using banking like transactions. when dealing with two accounts , changing from one account to another. how will we do using ejb's technology.
Do you mean to ask- How to use EJBs to do banking transactions, e.g. a simple transaction of withdrawing cash which will mean showing credit in one account and its corresponding debit in another account, so in database it may require updation in two or possible more tables.
- This can be done using bmp or cmp beans for inserting/updating data in database. To do validations before insertion/updation of data, you can use a session bean first, which on validation being successful will call bmps or cmps to make final updation in database.
The Transaction can be spanned thru all ejbs starting from first client call to session bean and then the following bmps or cmps that take part in above transaction, so that on anyone ejbs failure, the whole transaction is rolled back.