File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejb's interacting with two beans

 
sitaram irrinki
Ranch Hand
Posts: 158
  • 0
  • 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
  • 0
  • 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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic