As suggested by Figure 8 (Section 7.7.4) in the EJB 2.0 Specification, DB updates should be performed in the beforeCompletion method. May I ask why do you need to do that in the afterCompletion method?
In my opinion, beforeCompletion() method is lastest method that can be change commit or rollback transaction. afterCompletion(boolean flag) method is not run in transaction (non-TX) so in this method cannot commit or rollback. //if flag == true then commit //if flag == false then rollback please see detail in <b>life cycle of statefull session in EJB 2.0</b>
Java Developer, Thailand