• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB rookie questions

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Being a smart alec beats the alternative. This tiny ad knows what I'm talking about:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic