Michael,
Did you try Stripes 1.6 (trunk)? Because it has an working object
factory for Spring beans.
On 24-05-09 9:17, Michael Day wrote:
I'm trying to instantiate my ActionBeans through guice so that I can
put @Transactional annotations on my event handler methods. So far it
seems to be my
yes, I never do this. Testing action beans is very hard, testing a
service adapter is easy. Since I'm building 3 tier apps most of the
time there is no way to span a transaction over two webservice
calls(I'm not sure if a app server like jboss support this by using
java enterprise beans, but I'm
It's not impossible... If you extract the code that needs interception
into a separate class the ActionBean would not not need to be enhanced
by cglib. But I'm not sure if I really understood your problem so
excuse me if I'm wrong.
On Mon, May 25, 2009 at 2:56 AM, Michael Day
Yes, you are correct. But I am hoping to not have to do that. I want
the transaction around the entire event handling process so that every
database update will be rolled back any time a user sees an error page.
On May 25, 2009, at 2:33 AM, Richard Hauswald wrote:
It's not impossible...
I don't have anything simple enough to paste here, so I'll make up a
contrived example for user registration:
public Resolution execute() {
User user = registrationService.registerUser(username, password,
email);
// let's create an empty user profile for the newly created user
to
Ok, got it. In this case, your action bean is responsible for
validation, web site flow management, some business logic (create a
user profile when a new user is registered) and with a @Transactional
annotation also for transaction declaration. Doing this breaks the
single responsibility principle
I'm trying to instantiate my ActionBeans through guice so that I can
put @Transactional annotations on my event handler methods. So far it
seems to be my holy grail for transaction management in a web
environment, but it is proving difficult to attain. Has anyone
successfully done this?
I'm trying to instantiate my ActionBeans through guice so that I can
put @Transactional annotations on my event handler methods. So far it
seems to be my holy grail for transaction management in a web
environment, but it is proving difficult to attain. Has anyone
successfully done this?
Richard,
Thanks for the suggestion. I looked through the code, and it appears
that it would suffer from the same problems I identified. I neglected
to mention before that the problems are only occurring with
ActionBeans that have been enhanced by cglib. I'm guessing that
stripes-guice