1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?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:aop="http://www.springframework.org/schema/aop"
- xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context-3.0.xsd
- http://www.springframework.org/schema/aop
- http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"
- default-autowire="byName" default-lazy-init="true">
- <bean id="propertyCOnfigurer"
- class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
- <property name="location">
- <value>classpath:dbconfig.properties</value>
- </property>
- </bean>
- <bean id="nativeJdbcExtractor"
- class="org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor"
- lazy-init="true" />
- <bean id="oracleLobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler"
- lazy-init="true">
- <property name="nativeJdbcExtractor" ref="nativeJdbcExtractor" />
- </bean>
- <bean id="propertyCfg" class="com.gyee.intial.PropertyCacheContext">
- <property name="ignoreResourceNotFound" value="true" />
- <property name="locations">
- <list>
- <value>classpath:webconfig.properties</value>
- </list>
- </property>
- </bean>
- <bean id="sequence"
- class="org.springframework.jdbc.support.incrementer.OracleSequenceMaxValueIncrementer">
- <property name="incrementerName" value="SQ_ID" />
- <property name="dataSource" ref="dataSource" />
- </bean>
-
- <bean id="dataSource" class="com.jolbox.bonecp.BoneCPDataSource"
- destroy-method="close" p:driverClass="${oracle.driverClassName}"
- p:jdbcUrl="${oracle.url}" p:username="${oracle.username}" p:password="${oracle.password}"
- p:idleConnectionTestPeriodInMinutes="${cpool.idleConnectionTestPeriodInMinutes}"
- p:idleMaxAgeInMinutes="${cpool.idleMaxAgeInMinutes}"
- p:maxConnectionsPerPartition="${cpool.maxConnectionsPerPartition}"
- p:minConnectionsPerPartition="${cpool.minConnectionsPerPartition}"
- p:partitionCount="${cpool.partitionCount}" p:acquireIncrement="${cpool.acquireIncrement}"
- p:statementsCacheSize="${cpool.statementsCacheSize}"
- p:releaseHelperThreads="${cpool.releaseHelperThreads}" />
- <aop:config proxy-target-class="true">
- <aop:pointcut id="serviceOperation"
- expression="execution(* com.gyee.service..*Service.*(..))" />
- <aop:advisor pointcut-ref="serviceOperation" advice-ref="txAdvice"
- order="1" />
- </aop:config>
- <bean id="transactionManager"
- class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
- <property name="dataSource">
- <ref bean="dataSource" />
- </property>
- </bean>
- <tx:advice id="txAdvice" transaction-manager="transactionManager">
- <tx:attributes>
- <tx:method name="get*" read-only="true" rollback-for="Exception" />
- <tx:method name="find*" read-only="true" rollback-for="Exception" />
- <tx:method name="load*" read-only="true" rollback-for="Exception" />
- <tx:method name="unique*" read-only="true" rollback-for="Exception" />
- <tx:method name="*" rollback-for="Exception" />
- </tx:attributes>
- </tx:advice>
- <aop:aspectj-autoproxy proxy-target-class="true" />
- </beans>
|