Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 18625 invoked from network); 1 May 2009 02:22:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 May 2009 02:22:43 -0000 Received: (qmail 82662 invoked by uid 500); 1 May 2009 02:22:40 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 82604 invoked by uid 500); 1 May 2009 02:22:40 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 82594 invoked by uid 99); 1 May 2009 02:22:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 02:22:40 +0000 X-ASF-Spam-Status: No, hits=3.4 required=10.0 tests=HTML_MESSAGE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 195.130.137.66 is neither permitted nor denied by domain of voetsjoeba@gmail.com) Received: from [195.130.137.66] (HELO brigitte.telenet-ops.be) (195.130.137.66) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 02:22:32 +0000 Received: from [192.168.1.2] ([78.22.117.209]) by brigitte.telenet-ops.be with bizsmtp id m2NA1b0014X92660G2NAea; Fri, 01 May 2009 04:22:11 +0200 Message-ID: <49FA5CD0.5030703@gmail.com> Date: Fri, 01 May 2009 04:22:08 +0200 From: Jeroen De Ridder User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: Struts Users Mailing List Subject: Re: @Transactional Spring Annotation in a Struts2 Action does not work References: <313e92a60904301731n59b22643l70cdf9be02e45169@mail.gmail.com> <49FA45AA.1040203@yahoo.com> <313e92a60904301752l1ffc5ades5453d26bbbb522e1@mail.gmail.com> In-Reply-To: <313e92a60904301752l1ffc5ades5453d26bbbb522e1@mail.gmail.com> Content-Type: multipart/alternative; boundary="------------000108080601020100040206" X-Virus-Checked: Checked by ClamAV on apache.org --------------000108080601020100040206 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 which simply does not work at all with the proxies created by Spring. Regardless, making your actions @Transactional means mixing persistence concerns with controller logic in the same class. You should consider keeping the two separated. For example, the service approach is a good start: http://struts.apache.org/2.0.14/docs/struts-2-spring-2-jpa-ajax.html. > 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 wrote: > > >> 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 well. >>> >>> In my struts.config I setted the following constant: >>> ---- >>> >>> >>> >> You're using the Spring plugin, correct? >> >> Dave >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org >> For additional commands, e-mail: user-help@struts.apache.org >> >> >> > > --------------000108080601020100040206--