This week's book giveaway is in the Java in General forum. We're giving away four copies of 97 Things Every Java Programmer Should Know and have Kevlin Henney & Trisha Gee on-line! See this thread for details.
The EJB spec page 90 says that in the ejbCreate() and ejbRemove() methods of a BMT stateless session bean, it is OK to call getUserTransaction() but not to use any UserTransaction methods. Is this correct, and if so what would be the point of doing this? Head First EJB combines the two things together (get the transaction reference and call methods on it), and says (page 228) that these are *not* allowed in ejbCreate() and ejbRemove(). What is *really* allowed in these methods?
For Stateless Session Bean (either BMT or CMT) the transaction needs to start and end within a business method i.e we cannot end a method without ending the transaction. Moreover in SLSB the bean instance is associated with the client only during the Business method call. Hence during ejbCreate() and ejbRemove() having a transaction reference really doesnt help
You save more money with a clothesline than dozens of light bulb purchases. Tiny ad:
Devious Experiments for a Truly Passive Greenhouse!