<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">

<beans>

	<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"/>

	<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
		<property name="dataSource"><ref local="dataSource"/></property>
	</bean>

	<bean id="proxy1" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
		<property name="transactionManager"><ref local="transactionManager"/></property>
		<property name="target"><ref local="target1"/></property>
		<property name="transactionAttributes">
			<props>
				<prop key="*">PROPAGATION_REQUIRED</prop>
			</props>
		</property>
	</bean>

	<bean id="target1" class="org.springframework.beans.factory.xml.ConstructorDependenciesBean"
		autowire="constructor"/>

	<bean id="toBeFoundByType" class="org.springframework.beans.TestBean"/>

	<bean id="proxy2" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
		<property name="transactionManager"><ref local="transactionManager"/></property>
		<property name="target"><ref local="target2"/></property>
		<property name="transactionAttributes">
			<props>
				<prop key="*">PROPAGATION_REQUIRED</prop>
			</props>
		</property>
	</bean>

	<bean id="target2" class="org.springframework.beans.factory.xml.DependenciesBean">
		<property name="spouse">
			<bean class="org.springframework.beans.TestBean">
				<property name="someSet">
					<set>
						<ref local="proxy1"/>
					</set>
				</property>
			</bean>
		</property>
	</bean>

</beans>
