wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts Session Per Request Pattern? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Reply locked New topic
Author

Struts Session Per Request Pattern?

Jennifer Zhen
Greenhorn

Joined: May 24, 2009
Posts: 28
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.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts Session Per Request Pattern?
 
Similar Threads
Transaction-propagation
Errors with marking action method as @transactional
Spring Hibernate Transaction
Session per request pattern with Struts
Transaction ManageMent in Spring with Hibernate