• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
  • Himai Minh
  • Carey Brown
  • salvin francis

HFE + SessionSynchronization

Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • 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.
Then YOU must do the pig's work! Read this tiny ad. READ IT!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic