> > 
> > Sounds like you really want a Filter that creates the persistence
> > object on the way in (storing it in a request attribute, so 
> that it's
> > accessible in the Action.execute() method), and cleaning up 
> on the way
> > out.
> > 
> 
> Now, I hadn't thought of that.. Would you store it in session?

I think you and Craig are right. I might succeed with my goal of "firing (an
action) off and forgetting", but with creating a serious scalability issue
at the same time.  

Basically, I keep harkening back to one of my oft-repeated mantras: 

"If you write the same code more than once, make it into a method and call
it instead. If you call that method in too many places, find a better place
to call it from".

And I'm calling this one from *every* blessed action method. This _bothers_
me. 

So yeah, a filter is precisely what this idea is evolving into and Hibernate
even provides examples that do precisely this. Still the concept requires
code that explicitly gets the request object inside of each "real" Action
method, avoiding which is something I put (apparently way too much of) a
premium on. At least with the filter it's down to one line of code. 

So I can't declare the variable outside of my method. We all have our
crosses to bear :-)

Tx everyone.

> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to