• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

HFE + SessionSynchronization

 
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic