软件环境:
Jsp+hibernate+struts
配置文件:
<property name=”dialect”>net.sf.hibernate.dialect.OracleDialect</property>
<property name=”connection.driver_class”>oracle.jdbc.driver.OracleDriver</property>
<property name=”connection.username”>exam</property>
<property name=”connection.password”>exam</property>
<property name=”connection.url”>jdbc:oracle:thin:@192.168.0.24:1521:orcl</property>
<property name=”connection.pool.size”>1</property>
<property name=”statement_cache.size”>25</property>
<property name=”jdbc.fetch_size”>50</property>
<property name=”jdbc.batch_size”>30</property>
调试的时候程序显示debug信息为
DEBUG http8080-Processor2 net.sf.hibernate.connection.DriverManagerConnectionProvider – using pooled JDBC connection, pool size: 0
……….
DEBUG http8080-Processor2 net.sf.hibernate.connection.DriverManagerConnectionProvider – returning connection to pool, pool size: 1
………..
DEBUG http8080-Processor2 net.sf.hibernate.connection.DriverManagerConnectionProvider – using pooled JDBC connection, pool size: 1
……….
DEBUG http8080-Processor2 net.sf.hibernate.connection.DriverManagerConnectionProvider – returning connection to pool, pool size: 2
………
DEBUG http8080-Processor2 net.sf.hibernate.connection.DriverManagerConnectionProvider – using pooled JDBC connection, pool size: 2
……….
DEBUG http8080-Processor2 net.sf.hibernate.connection.DriverManagerConnectionProvider – returning connection to pool, pool size: 3
如果每次查询操作都能成功释放连接那么jdbc连接数和连接池连接数是不是应该不变?
总保持0和1?
程序每次执行都会执行session.close(),为什么还会有连接不能释放呢?