|
From: MacMahon, M. <M.M...@em...> - 2003-11-20 17:21:24
|
Hi all, Is it possible to apply an interceptor to a prototype bean? The prototype is stateful - i.e one per user I have defined the following in applicationContext.xml <bean id="TestTarget" class="test.MyTarget" singleton="false"> </bean> <bean id="TestInterceptor" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBe an" singleton="false"> <property name="transactionManager"><ref local="transactionManager"/></property> <property name="target"><ref local="TestTarget"/></property> <property name="transactionAttributes"> <props> <prop key="foo">PROPAGATION_REQUIRED</prop> </props> </property> </bean> When I invoke the method foo I get a ClassCastException If I change the TestInterceptor to singleton="true", it works fine but the bean is no longer a prototype! Is this a bug or a feature? Any help much appreciated, Regards, Mark. ____________________________________________________ emuse technologies U24 Trinity Enterprise Centre, Pearse Street, Dublin 2, Ireland. Tel: +353 (0)1 6717317 Fax: +353 (0)1 6717319 website: <http://www.emusetechnologies.com/> email: in...@em... <mailto:in...@em...> ____________________________________________________ This message has been scanned for viruses using GroupShield for Exchange Server. CONFIDENTIALITY NOTICE - The information contained in this email message is intended only for confidential use of the named recipient. If the reader is not the intended recipient or the person responsible for delivering it to the recipient, you are hereby notified that you have received this communication in error and that any review, dissemination or copying of this communication is strictly prohibited. If you have received this in error, please notify the sender immediately. The information, opinions and recommendations contained herein are and must be construed solely as statements of opinion and not statements of fact. No warranty, expressed or implied, as to the accuracy, timeliness, completeness, merchantability or fitness for any particular purpose of any such recommendation or information is given or made by emuse technologies in any form or manner whatsoever. |