欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Proxool DataSource

程序员文章站 2022-05-24 08:48:15
...

<bean id="dataSource"
class="org.logicalcobwebs.proxool.ProxoolDataSource">
<property name="driver">
<value>net.sourceforge.jtds.jdbc.Driver</value>
</property>
<property name="driverUrl">
<value>jdbc:jtds:sqlserver://192.168.1.1;DatabaseName=test;charset=utf-8;autoReconnect=true</value>
</property>
<property name="user">
<value>test</value>
</property>
<property name="password">
<value>test</value>
</property>
<property name="delegateProperties">
<value>user=test,password=test</value>
</property>
<property name="maximumConnectionCount">
<value>100</value>
</property>
<property name="minimumConnectionCount">
<value>10</value>
</property>
</bean>

<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource" />
</property>
<property name="mappingLocations">
<list>
<value>
classpath*:cn/**/*.hbm.xml
</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.connection.pool_size">100</prop>
<prop key="hibernate.connection.release_mode">
auto
</prop>
<prop key="hibernate.connection.autocommit">true</prop>
<prop key="hibernate.max_fetch_depth">3</prop>
<prop key="hibernate.default_batch_fetch_size">30</prop>
<prop key="hibernate.jdbc.batch_size">100</prop>
<prop key="hibernate.jdbc.fetch_size">50</prop>
<prop key="hibernate.order_updates">true</prop>
<prop key="hibernate.jdbc.use_scrollable_resultset">
true
</prop>
<prop key="hibernate.query.substitutions">
true 1, false 0
</prop>
<prop key="hibernate.cache.use_second_level_cache">
true
</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.cache.provider_class">
org.hibernate.cache.EhCacheProvider
</prop>
<prop key="net.sf.ehcache.configurationResourceName">
classpath:ehcache.xml
</prop>
</props>
</property>
</bean>