This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB rookie questions

 
Artemesia Lakener
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please help me, an EJB rookie, clarify the following confusions --

1. can I use transaction if I ONLY have stateless session bean ? please give me a simple example when this is appropriate.

2. can I use transaction if I ONLY use stateful session bean ?

3. is it true that if I use application server to handle transaction, I should NOT use JTA any more. And all I need to do is to set the transaction attributes in the xml file ? what else do I need to do for transaction ?
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Every type of EJB component: session bean (both SLSB and SFSB), entity bean (BMP and CMP) and message-driven-bean can have a transaction. They are mandatory for entity beans, optional for all the others.

You are correct. If you are using container-managed transactions then you don't write any JTA code. Everything is in the DD.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic