• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Use EJBs for transactions?

 
Seid Myadiyev
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Friends,
Question: Should you use EJBs even if there is NO data to persist in your application but there are transactions?
Correct Answer: YES
If I really do not have any data to persist but I need transactions can’t I just use JTS/JTA without having to incur the overhead involved with EJBs? Please share your knowledge on this subject!
Thanks, very much!
Seid
 
Tim Duncan
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you get other benefits from the container by using EJBs -- such as security and distribution. On the other hand couldn't you could get the same by using JTA with a session bean?
Where did the question come from? Was there no explanation for why they thought "Yes" was correct?
 
Seid Myadiyev
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim, thank you for your reply. Here is a complete copy-paste from mock exam. What do you think about it?
Q: You should use EJBs even if there is NO data to persist in your application but there are transactions.True/False?
A: It is recommended that you use Enterprise Javabeans if Transactions are involved in the application. See below for more details.The following is taken from:http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/EJBConcepts2.html
The application must be scalable. To accommodate a growing number of users, you may need to distribute an application's components across multiple machines. Not only can the enterprise beans of an application run on different machines, but their location will remain transparent to the clients. Transactions are required to ensure data integrity. Enterprise beans support transactions, the mechanisms that manage the concurrent access of shared objects. The application will have a variety of clients. With just a few lines of code, remote clients can easily locate enterprise beans. These clients can be thin, various, and numerous.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic