That's why you need to make it a lazy proxy (i.e. don't open a session
until you really NEED it, and even better, have a flag for whether it
was opened read-only or read-write and don't flush for read-only) and
set it into the ActionContext (or your own ThreadLocal)

> -----Original Message-----
> From: Matt Ho [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, October 25, 2003 2:13 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [OS-webwork] Hibernate with interceptor
> 
> 
> John Patterson wrote:
> 
> > I notice that in previous discussions on this list, people 
> talk a lot
> > about using ServletFilters to open a Session and ensure it 
> is closed.  
> > Is there any problem with using an interceptor to do this?
> 
> The main issue with using an interceptor is handling 
> chaining. Consider 
> the following chain where you have MyAction and 
> ChainedAction.  Here's 
> the sequence of events you'd end up with:
> 
> ... open MyAction session ...
> ... invoke MyAction ...
> ... open ChainedAction session ...
> ... invoke ChainedAction ...
> ... close ChainedAction session ...
> ... close MyAction Session ...
> 
> this probably isn't what you want :)
> 
> M
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: The SF.net Donation 
> Program. Do you like what SourceForge.net is doing for the 
> Open Source Community?  Make a contribution, and help us add 
> new features and functionality. Click here: 
> http://sourceforge.net/donate/ 
> _______________________________________________
> Opensymphony-webwork mailing list 
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
> 


-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community?  Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to