Hi,
I am stuck with the following problem: beans defined as children of a TransactionProxyFactoryBean are not being created just ones as expected, but multiple times.
serviceContext.xml:
To track the number of instances of the child bean being created, I added a static counter to the Constructor of the ApprovalManagerImpl class.Code:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="approvalManager" parent="managerBase"> <property name="target"> <bean class="my.domain.tts.domain.manager.impl.ApprovalManagerImpl" autowire="byType"> </bean> </property> <property name="proxyInterfaces"> <value> my.domain.tts.domain.manager.IApprovalManager </value> </property> </bean> <bean id="managerBase" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"> <ref bean="transactionManager" /> </property> <property name="transactionAttributes"> <props> <prop key="get*"> PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED,readOnly </prop> <prop key="find*"> PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED,readOnly </prop> <prop key="load*"> PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED,readOnly </prop> <prop key="store*"> PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED </prop> <prop key="update*"> PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED </prop> </props> </property> </bean> </beans>
The log shows that the ApprovalManagerImpl is being created many times, as if the application startup hangs in an infinite loop.
This also happens to other beans (omitted here) defined as children of the TransactionProxyFactoryBean.
I first was made aware of the problem when startup of the application context lead to my applications log filling up with these statements:
Any help would be appreciated.2005-08-16 15:01:47,887 INFO [main] [] org.springframework.beans.factory.support.DefaultL istableBeanFactory - Creating shared instance of singleton bean 'approvalManager'
Rgrds, Thomas


Reply With Quote