我修复了它=)我真的必须扎根寻找这个问题的答案。基本上,它涉及到加载元数据和JDBC驱动程序。它正在加载所有元数据,包括sql列旁边的注释和其他各种构造,这些都是 *** 作所不需要的。我不知道为什么默认情况下会启用此功能,但是除非明确需要,否则您应该关闭此功能:
config.setProperty("hibernate.temp.use_jdbc_metadata_defaults","false");
立即连接!
我可以找到的唯一信息是在代码中:
107 // 'hibernate.temp.use_jdbc_metadata_defaults' is a temporary magic value.108 // The need for it is intended to be alleviated with future development, thus it is109 // not defined as an Environment constant...110 //111 // it is used to control whether we should consult the JDBC metadata to determine112 // certain Settings default values; it is useful to *not* do this when the database113 // may not be available (mainly in tools usage).114 boolean useJdbcmetadata = ConfigurationHelper.getBoolean( "hibernate.temp.use_jdbc_metadata_defaults", configValues, true );
http://greppre.com/file/repo1.maven.org/maven2/org.hibernate/hibernate-core/4.1.1.Final/org/hibernate/engine/jdbc/internal/JdbcServicesImpl.java#JdbcServicesImpl
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)