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
posted 10 years ago
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.