On Fri, 17 Jan 2003 [EMAIL PROTECTED] wrote:

> Date: Fri, 17 Jan 2003 10:24:14 -0600
> From: [EMAIL PROTECTED]
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: transactions across multiple actions
>
> Hi all
>
> I'm tentatively planning on using multiple actions per request, one to
> process the input and another to process the output.  I've applied the Gang
> of Four's template method pattern to Action.execute() to
> create/commit/rollback a transaction.  Individual subclasses implement an
> overloaded execute() method and take it for granted that a txn is active.
> Is there a way to configure struts so each action in the chain, as well as
> the final jsp perhaps, all take place within the same transaction?  I've
> looked at RequestProcessor and don't see that it's the answer but it would
> be nice if there was something like that, though at a higher level.  For
> example, there would be a preprocess() method where I could start the txn, a
> process() method that would execute() all actions and jsps in the chain, a
> processException() method that would rollback the transaction, and a
> postprocess() method that would commit the transaction.  I'm assuming that
> processException() would be called before postprocess() of course.
>

As it happens, a "chain of responsibility" pattern like this is one of the
ideas I'm exploring for Struts 2.0.  If we set up the pattern so that it
acted like filters do in Servlet 2.3, it would be quite easy to get the
rollback behavior you want.

> thanks
>
> john gregg
> Wells Fargo Services Company
> Minneapolis, MN
>
>

Craig




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

Reply via email to