`
KG21
  • 浏览: 105626 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

proxool配置

阅读更多
<?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:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">

    <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>classpath:proxool.properties</value>
                <value>classpath:fogservice-client.properties</value>
                <value>classpath:uc-client.properties</value>                
            </list>
        </property>
    </bean>

    <bean id="dataSource" class="org.logicalcobwebs.proxool.ProxoolDataSource" destroy-method="close">
    <property name="driver">
      <value>${proxool.driverClass}</value>
    </property>
    <property name="driverUrl">
      <value>${proxool.jdbcUrl}</value>     
 <!--用户名和密码写在一起才调用成功,不然会报 调用无效的参数 错误,下面设置用户名和密码的property好像是无效的,其它数据库也是这样
 比如mysql的也要把用户名和密码写在url里:<property name="driverUrl" value="jdbc:mysql://localhost:3306/blogdb?user=lizongbo&amp;password=lizongbo" />
 -->
    </property>
    <property name="user"> <!-- 必须在这里也设置,但是 proxool却不使用它,或许是个bug-->
      <value>${proxool.user}</value>
    </property>
    <property name="password"> <!-- 必须在这里也设置,但是 proxool却不使用它,或许是个bug-->
      <value>${proxool.password}</value>
    </property>
    <property name="alias">
      <value>nexusProxool</value>
    </property>
    <property name="prototypeCount">
      <value>${proxool.minPoolSize}</value>
    </property>
    <property name="maximumConnectionCount">
      <value>${proxool.maxPoolSize}</value>
    </property>
    <property name="minimumConnectionCount">
      <value>${proxool.minPoolSize}</value>
    </property>
    <property name="trace">
      <value>true</value>
    </property>
    <property name="verbose">
      <value>true</value>
    </property>
    <property name="houseKeepingTestSql">
    	<value>show columns from t_tag_type</value>
    </property>
    <property name="simultaneousBuildThrottle">
    	<value>${proxool.simultaneous-build-throttle}</value>
    </property>
  </bean>

    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>

    <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
        <property name="configLocation" value="classpath:com/dao/ibatis/sqlmap/SqlMapConfig.xml"/>
        <property name="dataSource" ref="dataSource"/>
    </bean>


    <!--Transaction Manager-->
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <tx:method name="find*" read-only="true"/>
            <tx:method name="select*" read-only="true"/>
            <tx:method name="get*" read-only="true"/>
            <tx:method name="*" read-only="false" rollback-for="com.cmbtrip.exception.Exception"/>
        </tx:attributes>
    </tx:advice>


    <!--Transaction AOP-->

    <aop:config>
        <aop:pointcut id="expServiceOperation" expression="execution(* com.service.*.*(..))"/>
        <aop:advisor advice-ref="txAdvice" pointcut-ref="expServiceOperation"/>
    </aop:config>


</beans>



 proxool.property

proxool.driverClass=org.gjt.mm.mysql.Driver
proxool.jdbcUrl=jdbc:mysql://192.168.***.***:3306/DBname?useUnicode=true&characterEncoding=UTF-8
proxool.user=root
proxool.password=root
proxool.initialPoolSize=10
proxool.acquireIncrement=3
proxool.idleConnectionTestPeriod=3600
proxool.minPoolSize=5
proxool.maxPoolSize=10
proxool.maxStatements=20
proxool.numHelperThreads=10
proxool.maxIdleTime=600
proxool.houseKeepingSleepTime=90000
proxool.simultaneous-build-throttle=20

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics