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

Struts Session Per Request Pattern?

Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
So in Struts, I used an interceptor to open a Spring transaction and commit/rollback later.

Behind the action layer, I do have a service layer providing services to the action classes.

Does it still make sense to have the service method transaction marked as propagation='required'? since a transaction has already been opened at the beginning of the request, propagation='required' would end up with a serial of commits/roll-backs of small nested transactions in the service methods. or would it be more efficient to have the methods marked as propagation="support" or "mandatory" so only one transaction is dealt?

Besides, is it always necessary to manually open a session when opening a transaction? as a session is automatically opened when opening a transaction anyway. And in contrast with many people say about the difference between getSession() and getCurrentSession(), they all used this single same session opened by the transaction. So I got the same session throughout the request no matter what.

did I miss anything?

New to the topic. Any hints/corrections would be appreciated.

Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic