Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejb's interacting with two beans

 
sitaram irrinki
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Damanjit Kaur
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic