<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns='http://www.springframework.net'
         xmlns:d="http://www.springframework.net/database"
         xmlns:tx="http://www.springframework.net/tx"
         xmlns:aop="http://www.springframework.net/aop">


  <!-- Available Catalogs: CreditsAndDebits, Credits, Debits -->

  <!-- Database Providers -->

  <d:provider id="DebitDbProvider"
               provider="SqlServer-2.0"                                       
               connectionString="Data Source=SPRINGQA;Initial Catalog=Debits;Persist Security Info=True;User ID=springqa;Password=springqa"/>
  <!--
               connectionString="Data Source=SPRINGQA\SQLEXPRESS;Initial Catalog=Debits;Integrated Security=True;Pooling=False"/>
           -->

  <d:provider id="DbProvider"
                provider="SqlServer-2.0"
                connectionString="Data Source=SPRINGQA;Initial Catalog=Credits;Persist Security Info=True;User ID=springqa;Password=springqa"/>
  <!--
                  connectionString="Data Source=SPRINGQA\SQLEXPRESS;Initial Catalog=Credits;Integrated Security=True;Pooling=False"/>
                  -->



  <!-- Transaction Manager -->
  <!--
    <object id="transactionManager" 
            type="Spring.Data.Core.AdoPlatformTransactionManager, Spring.Data">
      <property name="DbProvider" ref="DbProvider"/>
    </object>
    -->

  <object id="transactionManager"
          type="Spring.Data.Core.TxScopeTransactionManager, Spring.Data">
  </object>


  <!-- AdoTemplate for DAO Implementation -->
  <object id="adoTemplate" type="Spring.Data.Core.AdoTemplate, Spring.Data">
    <property name="DbProvider" ref="DbProvider"/>
  </object>

  <object id="adoTemplateForDebitDb" type="Spring.Data.Core.AdoTemplate, Spring.Data">
    <property name="DbProvider" ref="DebitDbProvider"/>
  </object>

  <!-- DAO Implementations -->
  <object id="accountCreditDao" type="Spring.Data.AccountCreditDao, Spring.Data.Integration.Tests">
    <property name="AdoTemplate" ref="adoTemplate"/>
  </object>

  <object id="accountDebitDao" type="Spring.Data.AccountDebitDao, Spring.Data.Integration.Tests">
    <property name="AdoTemplate" ref="adoTemplateForDebitDb"/>
  </object>

  <!-- AOP Transactional Proxy Configuration for 'ServiceLayer' -->

  <!-- The DAO object that performs multiple data access operations -->
  <object id="accountManager"
          type="Spring.Data.AccountManager, Spring.Data.Integration.Tests">
    <property name="AccountCreditDao" ref="accountCreditDao"/>
    <property name="AccountDebitDao" ref="accountDebitDao"/>
  </object>


  <tx:attribute-driven transaction-manager="transactionManager"/>

  <!-- Transactional Proxy for TestObjectManager using the ProxyFactoryObject -->

  <!--
  <object id="accountManager"
          type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop">

    <property name="Target" ref="accountManagerTarget"/>
    <property name="ProxyInterfaces">
      <value>Spring.Data.IAccountManager</value>
    </property>
    <property name="InterceptorNames">
      <value>transactionInterceptor</value>
    </property>

  </object>
  -->



  <!-- Transaction Interceptor -->
  <!-- note do not have converter from string to TransactionAttributeSource property type registered -->
  <!--
  <object id="transactionInterceptor"
          type="Spring.Transaction.Interceptor.TransactionInterceptor, Spring.Data">
    <property name="TransactionManager" ref="transactionManager"/>

    <property name="TransactionAttributeSource" ref="attributeTransactionAttributeSource"/>
  </object>

  <object id="attributeTransactionAttributeSource"
          type="Spring.Transaction.Interceptor.AttributesTransactionAttributeSource, Spring.Data">
  </object>
  -->

  <object name="loggingAdvice" type="Spring.Aspects.Logging.SimpleLoggingAdvice, Spring.Aop">
    <property name="logUniqueIdentifier" value="true"/>
    <property name="logExecutionTime"    value="true"/>
    <property name="logMethodArguments"  value="true"/>
    <property name="Separator"           value=";"/>
    <!--
    <property name="LogLevel"            value="Debug"/>
    -->
  </object>

  <object id="txAttributePointcut" type="Spring.Aop.Support.AttributeMatchMethodPointcut, Spring.Aop">
    <property name="Attribute" value="Spring.Transaction.Interceptor.TransactionAttribute, Spring.Data"/>
  </object>

  <aop:config>
    <!--
    <aop:advisor id="exceptionProcessAdvisor" order="1"
                 advice-ref="exceptionAdvice" 
                 pointcut-ref="txAttributePointcut"/>
                 -->

    <aop:advisor id="loggingAdvisor" order="2"
             advice-ref="loggingAdvice"
             pointcut-ref="txAttributePointcut"/>
  </aop:config>

</objects>