|
From: Kopylenko, D. <dko...@ac...> - 2003-09-04 12:34:46
|
Colin,
I'll update it in the CVS.
Regards,
Dmitriy.
-----Original Message-----
From: Colin Sampaleanu [mailto:col...@ex...]
Sent: Wednesday, September 03, 2003 6:35 PM
To: 'springframework-developer '
Cc: ben...@ac...
Subject: [Springframework-developer] TransactionInterceptor setup in the
webapp-aop skeleton file is bad
In the file
samples/skeletons/webapp-aop/WEB-INF/applicationContext.xml
there is an example of how to set up a transaction interceptor. It is
using the old mechanism, which is not the problem, but is wrong, which
is the problem.
The example uses
<bean id="exampleTransactionInterceptor"
class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager"><ref
bean="myTransactionManager"/></property>
<property name="transactionAttributeSource">
<value>
example.ExampleBusinessObject.exampleMethod=PROPAGATION_REQUIRED
example.ExampleBusinessObject.anotherExampleMethod=PROPAGATION_REQUIRED
</value>
</property>
</bean>
<bean id="exampleBusinessObject"
class="org.springframework.aop.framework.ProxyFactoryBean">
<property
name="proxyInterfaces"><value>example.ExampleBusinessInterface</value></prop
erty>
<property
name="interceptorNames"><value>exampleTransactionInterceptor,exampleBusiness
ObjectTarget</value></property>
</bean>
Now this is specifyng that ExampleBusinessObject.exmpleMethod and
ExampleBuisnessObject.anotherExampleMethod should be intercepted and
handled transactionally, but if the user comes in via the interface
ExampleBusinessInterface like he should be, then the interceptor will
not match up on the method names, since the class he is coming in as is
ExampleBusinessInterface not the ExampleBusinessObject the interceptor
is looking for.
This is the exact problem that Ben Alex was having last week (but I
didn't spot it at the time). Hopefully he didn't give up on spring yet :-)
Can somebody fix this? Also, fwiw this doesn't happen with the new,
streamlined mechanism, TransactionProxyFactoryBean, since there you
directly point to the object you are proxying, and match the method
coming in regardless.
Also, it's probably worth updating the example to show both the old
mechanism and the new one.
Regards,
Colin
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf _______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|