On Nov 8, 2007, at 4:04 PM, hu bo wrote:

Hi,

In Bean managed transaction, can I call userTransaction.begin in on sessionbean method, and call userTransaction.commit in another sessionbean method?
Yes, if it is a Stateful Session bean and you are using the same instance for both calls.
Is there any difference between stateful and stateless session bean about this?
Yes, it only works with stateful session beans and you have to be careful to use the same instance for all calls in the transaction. With stateless session beans a transaction you start in a method must be completed before the method returns. With stateless session beans there is no concept of "same instance" between calls.

david jencks


Thanks,

Reply via email to