posted 18 years ago
Hi,
I just would like to mention something concerning SessionSynchronization that is perhaps not enough detailed in HFE (cf p.511-512-513) or not enough clear - to my sense.
The point is the following: if the the transaction won't commit, don't forget that method beforeCompletion won't be called!
So, by example, if a system exception is thrown in the bean, you will have the following sequence:
afterBegin() -> business method, ->afterCompletion(false).
That's only in the case of sucessfull commit that the beforeCompletion will be called before afterCompletion! This method will usually be used to write any cached updates to the database.
cf spec p.78.
Regards,
Cyril.
SCJP 1.4, SCWCD, SCBCD, IBM XML, IBM Websphere 285, IBM Websphere 287