Re: @Transactional Spring Annotation in a Struts2 Action does not work

2009-05-07 Thread Rene Gielen
You should consider to have a look into the paramsPrepareParams pattern (see struts-default.xml for a brief description) and to write and use a TransactionInterceptor. The latter one gives you the same cross cutting TX approach you want from your @Transational annotation, but in addition to

Re: @Transactional Spring Annotation in a Struts2 Action does not work

2009-05-04 Thread Mauricio Aniche
Wes, I just put the proxy-target-class=true, put all cglib and its dependencies and everything worked! Thanks in advance, Mauricio On Fri, May 1, 2009 at 9:32 AM, Wes Wannemacher w...@wantii.com wrote: See if you can force Spring to use CGLIB proxies... JDK proxies are interface-based, so

Re: @Transactional Spring Annotation in a Struts2 Action does not work

2009-05-04 Thread Frans Thamura
will u make a tiny tutori for your work like struts-spring-ajax and put in the wiki of S2 that will be awesome ;) F On Tue, May 5, 2009 at 10:17 AM, Mauricio Aniche mauricioani...@gmail.com wrote: Wes, I just put the proxy-target-class=true, put all cglib and its dependencies and everything

Re: @Transactional Spring Annotation in a Struts2 Action does not work

2009-05-02 Thread dusty
Jeroen, This setup is so that you can initiate and control the properties of the transaction from the controller, if that is a pattern you require? Do you do this for all your calls to the service layer from controllers, and how is it better/different from a calling a service method annotated

Re: @Transactional Spring Annotation in a Struts2 Action does not work

2009-05-02 Thread Frans Thamura
discuss about this is it possible the working version share to us so we can see the thing here F On Sat, May 2, 2009 at 11:57 PM, dusty dustin_pea...@yahoo.com wrote: Jeroen, This setup is so that you can initiate and control the properties of the transaction from the controller, if that

Re: @Transactional Spring Annotation in a Struts2 Action does not work

2009-05-02 Thread Jeroen De Ridder
Hi Dustin, Yes, I do require the ability to be able to manually set transaction boundaries from controller code. The main reason is because Hibernate updates database records when a persistent object changes state during a transaction. It picks up on the changes made to the object when the

Re: @Transactional Spring Annotation in a Struts2 Action does not work

2009-05-01 Thread Wes Wannemacher
See if you can force Spring to use CGLIB proxies... JDK proxies are interface-based, so unless you are implementing an interface that exposes all of the methods you will interact with (Action interface has no methods, IIRC), then AOP / @Transactional won't work right. Although, carry on with the

@Transactional Spring Annotation in a Struts2 Action does not work

2009-04-30 Thread Mauricio Aniche
Hi, I am using Struts2+Spring+JPA/Hibernate. When I use the @Transactional to mark an execute() method in a Struts2 Action, the action stops working properly (i.e. the attributes in the action are not automatically setted). It does not work with Spring AOP transactions as well. In my

Re: @Transactional Spring Annotation in a Struts2 Action does not work

2009-04-30 Thread Dave Newton
Mauricio Aniche wrote: I am using Struts2+Spring+JPA/Hibernate. When I use the @Transactional to mark an execute() method in a Struts2 Action, the action stops working properly (i.e. the attributes in the action are not automatically setted). It does not work with Spring AOP transactions as

Re: @Transactional Spring Annotation in a Struts2 Action does not work

2009-04-30 Thread Mauricio Aniche
Yes, I am. Everything works fine when I don't try to use Spring transactional AOP! Mauricio On Thu, Apr 30, 2009 at 9:43 PM, Dave Newton newton.d...@yahoo.com wrote: Mauricio Aniche wrote: I am using Struts2+Spring+JPA/Hibernate. When I use the @Transactional to mark an execute() method in

Re: @Transactional Spring Annotation in a Struts2 Action does not work

2009-04-30 Thread Jeroen De Ridder
You really shouldn't be making your Struts 2 actions @Transactional. Doing that causes Spring to create a proxy so it can put some extra transaction-handling logic between the method call and the actual method. The thing is, Struts 2 and OGNL rely heavily on reflection on the action classes

Re: @Transactional Spring Annotation in a Struts2 Action does not work

2009-04-30 Thread Mauricio Aniche
Hi Jeroen, The problem is that I am not a big fan of services layer. Sometimes it looks very anemic to me. But I totally agree with you when you say the action should not know about persistence problems, and that's why I want to do it via AOP. I had the same thought about the problem: the Spring

Re: @Transactional Spring Annotation in a Struts2 Action does not work

2009-04-30 Thread Jeroen De Ridder
I'll agree that a service layer alone won't cut it, simply because of the way JPA/Hibernate works. Updating an instance for example is just something that doesn't belong in a service. I'm by no means an expert of best practices in JPA/Hibernate and Spring, but I've found a combination of