<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<beans default-lazy-init="true">

  <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
  </bean>

  <bean id="ds" class="org.springframework.jndi.JndiObjectFactoryBean">
    <!-- WLS -->
    <property name="jndiName"><value>com.bea.wlpi.TXDataSource</value></property>
    <!-- JBoss -->
    <!--property name="jndiName"><value>java:/TXDataSource</value></property-->
  </bean>

  <bean id="aImpl" class="txsuspend.spring.BeanA">
    <property name="dataSource">
        <ref local="ds"/>
    </property>
    <property name="beanB">
        <ref local="b"/>
    </property>
  </bean>

  <bean id="bImpl" class="txsuspend.spring.BeanB"/>

  <bean id="a" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    <property name="transactionManager"><ref local="transactionManager"/></property>
    <property name="target"><ref local="aImpl"/></property>
    <property name="transactionAttributes">
      <props>
        <prop key="*">PROPAGATION_REQUIRES_NEW</prop>
      </props>
    </property>
  </bean>

  <bean id="b" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    <property name="transactionManager"><ref local="transactionManager"/></property>
    <property name="target"><ref local="bImpl"/></property>
    <property name="transactionAttributes">
      <props>
        <prop key="*">PROPAGATION_REQUIRES_NEW</prop>
      </props>
    </property>
  </bean>

</beans>
