our spring config

<?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="dataSource"
class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="driverClass">
<value>net.sourceforge.jtds.jdbc.Driver</value>
</property>
<property name="jdbcUrl">
<value>jdbc:jtds:sqlserver://localhost;DatabaseName=XXX</value>
</property>
<property name="user">
<value>xx</value>
</property>
<property name="password">
<value>xx</value>
</property>
<property name="initialPoolSize">
<value>10</value>
</property>
<property name="minPoolSize">
<value>5</value>
</property>
<property name="maxPoolSize">
<value>100</value>
</property>
<property name="acquireIncrement">
<value>5</value>
</property>
<property name="maxIdleTime">
<value>10</value>
</property>
<property name="maxStatements">
<value>0</value>
</property>
</bean>
  <bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
<prop key="hibernate.show_sql">
false
</prop>
</props>
</property>
<property name="mappingResources">
<list>

<!-- 软件研发管理 -->
<value>com/sino/mis/software/model/SrdSystem.hbm.xml</value>
<value>com/sino/mis/software/model/SrdFunction.hbm.xml</value>
<value>com/sino/mis/software/model/SrdFuncPmProjMap.hbm.xml</value>

</list>
</property></bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory"/>
</property></bean>
<bean id="hibernateInterceptor" class="org.springframework.orm.hibernate3.HibernateInterceptor">
    <property name="sessionFactory">
      <ref bean="sessionFactory"/>
    </property></bean>
<bean id="txProxyTemplate" abstract="true"
        class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
  <property name="transactionManager" ref="transactionManager"/>
  <property name="transactionAttributes">
    <props>
    <prop key="add*">PROPAGATION_REQUIRED</prop>
    <prop key="create*">PROPAGATION_REQUIRED</prop>
    <prop key="del*">PROPAGATION_REQUIRED</prop>
    <prop key="save*">PROPAGATION_REQUIRED</prop>
      <prop key="remove*">PROPAGATION_REQUIRED</prop>
      <prop key="update*">PROPAGATION_REQUIRED</prop>
      <prop key="modify*">PROPAGATION_REQUIRED</prop>
      <prop key="insert*">PROPAGATION_REQUIRED</prop>
      <prop key="set*">PROPAGATION_REQUIRED</prop>
<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="is*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="move*">PROPAGATION_REQUIRED</prop>
    </props>
  </property>
</bean>
</beans>

猜你喜欢

转载自echo46219519.iteye.com/blog/1333881