<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:tx="http://www.springframework.org/schema/tx"
 xmlns:aop="http://www.springframework.org/schema/aop"
 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">

  
 <!-- proxool连接池配置 -->
 <bean id="dataSource" class="org.logicalcobwebs.proxool.ProxoolDataSource" destroy-method="close">
  <!--
  <property name="alias" value="${jdbc.defaultCatalog}"/>
   -->
  <property name="driver" value="${jdbc.driverClassName}"/>
  <property name="driverUrl" value="${jdbc.url}"/>
  <property  name ="delegateProperties" >
             <value>user=${jdbc.username},password=${jdbc.password}</value>
        </property >
        <property name="user" value="${jdbc.username}"/>
  <property name="password" value="${jdbc.password}"/>
 </bean>

 
 
 
 
 <!-- Transaction manager for a single JDBC DataSource -->
 <!-- (see dataAccessContext-jta.xml for an alternative) -->
 <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  <property name="dataSource" ref="dataSource"/>
 </bean>
 
 
 <!-- 配置事务特性 -->
 <tx:advice id="txAdvice" transaction-manager="transactionManager">
  <tx:attributes>
      <tx:method name="save*" propagation="REQUIRED" rollback-for="SBServiceException"/>
      <tx:method name="delete*" propagation="REQUIRED" rollback-for="SBServiceException"/>
      <tx:method name="update*" propagation="REQUIRED" rollback-for="SBServiceException"/>
      <tx:method name="*" read-only="true"/>
  </tx:attributes>
 </tx:advice>
 <!-- 配置事务的方法进行事务管理 -->
 <aop:config>
  <aop:pointcut id="allManagerMethod" expression="execution (* com.sevenb2b.b2b.service..*(..))" />
  <aop:advisor advice-ref="txAdvice" pointcut-ref="allManagerMethod"/>
 </aop:config>

 <!-- SqlMap setup for iBATIS Database Layer -->
 <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
  <property name="configLocation" value="WEB-INF/sql-map-config.xml"/>
  <property name="dataSource" ref="dataSource"/>
 </bean>

 <!-- ========================= DAO DEFINITIONS: IBATIS IMPLEMENTATIONS ========================= -->
 <bean id="baseDao" class="com.sevenb2b.b2b.dao.ibatis.SqlMapDaoTemplate">
  <property name="sqlMapClient" ref="sqlMapClient"/>
 </bean>

 <!-- 商品类别 -->
 <bean id="sevenProductCategoryDao" class="com.sevenb2b.b2b.dao.ibatis.SevenProductCategoryDaoImpl" parent="baseDao" scope="singleton"/>
 
 
</beans>