m**c 发帖数: 192 | 1 环境为spring + hibernate 数据库为mysql 访问数据库之前
在log中总是看到这个
XmlBeanDefinitionReader - Loading XML bean definitions from class path
resource [org/springframework/jdbc/support/sql-error-codes.xml]
然后就开始load 八种数据库的一些属性 会打出很多log信息
每次运行都会这样 全部八种都load完以后出现:
SQLErrorCodesFactory - SQLErrorCodes loaded: [DB2, HSQL, MS-SQL, MySQL,
Oracle, Informix, PostgreSQL, Sybase]
然后开始找mysql的SQL error codes 但实际上我只用mysql 跟其它数据库无关
但是它为什么每次都load这些信息呢? 能不能让它不load这些东西?
是不是要修改spring.jar中的东西?
我的应用是一个最简单的spring + hibernate的应用 | m******t 发帖数: 2416 | 2 It's not always possible for spring to predict, at startup time, which
database it will encounter at run-time. You could try to override that xml
file on your classpath with lazy-init enabled, but I really don't see it's
worth the trouble. 7 extra beans with 6-7 properties each. Surely your
server has that much memory spare. 8-) |
|