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

Stateful EJB with CMT

 
Eleonora Di Pietro
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am going to save the itinerary into the db as soon as the customer confirms it. And saving the itinerary also requires saving all the segments it is made of.
My question is: what type of transaction is better to use in such a situation? BMT or CMT? I would prefer to use CMT for the following reason:
1. the operations to be performed on the db are not so complex
2. I would use CMP (CMP+BMT should not be possible)

Anyway, I still have a doubt because the ejb which interfaces entity beans for saving itineraries is a stateful session bean and I read somewhere that it is a risk to use stateful session bean with CMT because the container could destroy the ejb instance if an exception occurs. Is this true? Can you give me your suggestion about it?

Thanks a lot in advance. Regards
Eleonora Di Pietro
 
sammaiah kyatham
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think, Incase of system exception only the container destroys the bean instance otherwise there will not be a problem. And this is the same case even BMT aswell.

So I would say CMP,CMT,SSB would be fine for your requirement.


Thnx,
Sam
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic