之前参与的一个项目。用的框架:ssh+proxool 。struts-2.0, spring-1.2.3,hibernate3.24,proxool-0.8.3,数据库oralce。为什么每一次启动后,第一次访问加载时间都要15~30分钟。系统已经运行了好几年,数据库也比较大,表空间已经将近700G,表数量1W多个,表数据量也比较大,有些表将上亿数据量。是否hbm2ddl.auto=update的原因呢?
以下是hibernate,proxool的配置:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <!-- Generated by MyEclipse Hibernate Tools.                   -->
<hibernate-configuration><session-factory>
 <property name="hbm2ddl.auto">update</property>
 <property name="show_sql">true</property>
 <property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>        <!-- JDBC驱动程序 -->        
 <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>        
 <property name="hibernate.proxool.pool_alias">mssqlProxool</property>        
 <property name="hibernate.proxool.xml">proxool.xml</property>        
 <property name="hibernate.connection.provider_class">org.hibernate.connection.ProxoolConnectionProvider</property> <property name="lazy">true</property>
<property name="connection.release_mode">auto</property>
<property name="show_sql">false</property>
<property name="connection.autocommit">true</property>
<mapping
resource="com/do1/knowledge/model/Importdatarecord.hbm.xml" />
<mapping resource="com/do1/knowledge/model/Loginlog.hbm.xml" />
<mapping resource="com/do1/knowledge/model/MfUser.hbm.xml" />
<mapping
resource="com/do1/knowledge/model/PortCommmobiledata.hbm.xml" />
<mapping
resource="com/do1/knowledge/model/PortCommtablecolumn.hbm.xml" />
<mapping
resource="com/do1/knowledge/model/PortCommtabledata.hbm.xml" />
<mapping
resource="com/do1/knowledge/model/PortCommtableorigin.hbm.xml" />
<mapping resource="com/do1/knowledge/model/Smaccesscontrol.hbm.xml" />
<mapping resource="com/do1/knowledge/model/Smaccesstype.hbm.xml" />
<mapping resource="com/do1/knowledge/model/Smfunction.hbm.xml" />
<mapping resource="com/do1/knowledge/model/Smorgan.hbm.xml" />
<mapping resource="com/do1/knowledge/model/Smrole.hbm.xml" />
<mapping resource="com/do1/knowledge/model/Smuser.hbm.xml" />
<mapping resource="com/do1/knowledge/model/Smuserrole.hbm.xml" />
<mapping resource="com/do1/knowledge/model/Tclogs.hbm.xml" />
<mapping
resource="com/do1/knowledge/model/Oracleimportingqueue.hbm.xml" /></session-factory></hibernate-configuration><?xml version="1.0" encoding="UTF-8"?>
<!--
  the proxool configuration can be embedded within your own application's.
  Anything outside the "proxool" tag is ignored.
-->
<something-else-entirely>
  <proxool>
    <alias>mssqlProxool</alias>
    <driver-url>jdbc:oracle:thin:@127.0.0.1:1521:orcl</driver-url>
    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
    <driver-properties>
      <property name="user" value="test" /><!-- gzquery 123 -->
      <property name="password" value="123456" />
    </driver-properties>
    <house-keeping-test-sql>select 1 from dual</house-keeping-test-sql>
    <house-keeping-sleep-time>90000</house-keeping-sleep-time>
    <simultaneous-build-throttle>10</simultaneous-build-throttle>
    <maximum-connection-count>100</maximum-connection-count>
    <minimum-connection-count>10</minimum-connection-count>
    <maximum-connection-lifetime>3600000</maximum-connection-lifetime>
  </proxool>
</something-else-entirely>