• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

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
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.
    Bookmark Topic Watch Topic
  • New Topic