Howdy -- a transaction will NOT stay open at the end of the method that created the transaction, EXCEPT with a BMT stateFUL session bean. A stateFUL session bean using BMT is allowed to begin() a transaction in one method, and end it in some other method. But this is really really dangerous and probably stupid, because it could leave the transaction open... which means the bean can never be passivated!! (there's a picture in HFEJB about the clueless guy who doesn't care about stateful bean scalability and leaves his transactions open)
So, with a stateLESS bean, and any other CMT bean, the transaction will end when the method ends (or in the case of a BMT, when the bean ends the transaction programmatically, but it MUST occur before the end of the method).
But with a stateFUL bean, using BMT, a transaction can begin() in one method, but not rollback() or commit() even when the method ends.
Now, there IS a way in which a non bean client can actually start a transaction that propogates into the bean, but it is NOT required in the EJB spec that a container allow this. In the J2EE spec, however, it does specify that a J2EE server CAN choose to make a UserTransaction object available through JNDI to certain clients that the J2EE server is controlling, like a
Servlet or even a "J2EE application client".
cheers,
Kathy