On Tuesday, February 25, 2003, at 02:54 PM, Anders Engström wrote:

We want each HTTP-request to run under the scope of one transaction in
the business layer. This is where I need some advice - how do we best
utilize WW to achieve this?

Most of the transactions in our application are initiated on the server when we make a call to a SLSB, however in those few cases where we need to enforce a transaction for the entire scope of an HTTP request we use the UserTransaction object.


We want to use action chaining, so I thought of writing a
WWActionExecutioner (Stateless Session EJB) that receive all actions
to execute in a request. This bean would have one method - execute(List
actions) : String - with transaction attributes set to 'required'. This
way each action can perform business calls on different sessions beans
under the same transaction.

Sorry but this doesn't make much sense to me. When you say Actions, I guess you are not referring to WW actions. If you are, I think you may need to re-read some documentation. :-)


Looking at the codebase (CVS) it looks like this should be doable by
"remoting"/wrapping GenericDispatcher as an EJB.

The above ought to be a pretty common scenario - so I would appreciate
comments, advices etc. :)

umm...I guess you _did_ mean WebWork actions...


There are a bunch of ways to get a transaction to wrapper the entire HTTP call if you want to go to that extreme. Here are a couple:

1. Subclass ActionSupport to create a UserTransaction before execute(), and stick it in the request. If you chain to another action, you want to check if a UserTransaction is currently active. If it is, you do nothing as you don't want to create nested transactions. After execute(), you issue your commit. You can rollback if there is a problem.

2. Use a filter to implement similar logic.



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to