Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about transaction and EJB and servlet

 
air lulu
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
question:
You are working for a web design company and one of your clients would like to convert their website that currently uses Perl and CGI scripts over to a language that is easier to maintain and reuse. Their website is a sports betting website where the customer is able to logon and place bets on a variety of different sporting events. What would you replace this with?
AJSP/Servlets
BJSP/Servlets/EJBs
CJMS
DASP
Choice B is correct.

the reason given is that "transactions are involved and this means that Enterprise Java Beans need to be used. It is very hard to implement transactions with just Servlets and JSPs".

but i don't understand why it is hard to implement transaction with servlet?(considering distritbuted tx is not involved)
 
karthikeyan Chockalingam
Ranch Hand
Posts: 259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only EJBs have CMT (container managed transaction) which is considered easy to use when compared to programmatic transaction control.
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Transaction3.html
[ September 21, 2006: Message edited by: karthi keyan ]
 
Cleuton Sampaio
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For most programmers it is easier to create an EJB and let transaction control to be handled by the container.

But there is a subtle problem here. It is a sports bet site, so you may need to have a finner transaction control and, in this case, CMT will not be appropriate.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic