hibernate-distribution-3.5.3-Final\project\etc\hibernate.properties ########################### ### C3P0 Connection Pool### ########################### #hibernate.c3p0.max_size 2 初始化池中最大个数 #hibernate.c3p0.min_size 2 最小个数 #hibernate.c3p0.timeout 5000 超时时间s #hibernate.c3p0.max_statements 100 #hibernate.c3p0.idle_test_period 3000 空闲3000s时,测试connection是否有效 #hibernate.c3p0.acquire_increment 2 当池满时初始化connection个数 #hibernate.c3p0.validate false 校验connection是否有效(能否与DBMS正常通信) <!-- 最大连接数 --> <property name="hibernate.c3p0.max_size">20</property><!-- 最小连接数 --><property name="hibernate.c3p0.min_size">5</property><!-- 获得连接的超时时间,如果超过这个时间,会抛出异常,单位毫秒 --><property name="hibernate.c3p0.timeout">120</property><!-- 最大的PreparedStatement的数量 --><property name="hibernate.c3p0.max_statements">100</property><!-- 每隔120秒检查连接池里的空闲连接connection ,单位是秒--><property name="hibernate.c3p0.idle_test_period">120</property><!-- 当连接池里面的连接用完的时候,C3P0一下获取的新的connection连接数 --><property name="hibernate.c3p0.acquire_increment">2</property><!-- 每次都验证连接是否可用 --><property name="hibernate.c3p0.validate">true</property>
Hibernate c3p0连接池
最新推荐文章于 2021-01-27 12:16:03 发布