Can I just clarify my understanding of something.
Suppose there is a client (which is outside the
EJB container) that needs to call a stateless session bean method to update the DB and then get confirmation from the user that the transaction is OK. Should this be done as follows.
1. Client gets a UserTransaction and invokes the begin() method.
2. Client invokes bean method.
3. Client prompts user for confirmation (assume that the bean method returns OK)
4. If user says OK, client imvokes commit(), else invokes rollback().
Furthermore, should the bean be CMT, ie the DD has this entry:
<transaction-type>Container</transaction-type>
And with this transaction attribute:
<trans-attribute>Required</trans-attribute>
My thinking is that the client transaction will propogate into the CMT bean and that the bean's method will run in the existing transaction as it has the Required attribute.
Does this make sense?