之前参与的一个项目。用的框架: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>
以下是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>
解决方案 »
- org.xml.sax.SAXParseException 异常
- 随便看看
- Hibernate 中怎么用left join 啊?
- javaw could not find the main class的問題,牛人来看看吧,似乎不是设置问题
- Tomcat服务器解析hibernate.cfg.xml文件时提示连接超时,求解决!
- 信息提醒在JSP中如何实现呢??虚心请教
- 微软的xml解析器msxml现在用的人多吗?是不是被淘汰了?
- Tomcat5中关于 oracle驱动 classes12.jar 路径问题
- 诸位大哥不才想问(1)在win系统下java如何调用系统的dll,(2) 怎么读取word等office文档?????
- 表名要改了,我的cmp能通过相关设置的改变而不需要重新写一次吗?
- 初学者虚心求一个mvc的问题!大家一起讨论讨论
- 求帮忙看看这个HQL语句怎么写
应该有影响,修改为:none试试