去掉启动项目时hibernate数据库表检查
websphere项目启动时每次都会检查数据库表,浪费很长时间,查看配置文件后,原来是
<property name="hibernate.hbm2ddl.auto">update</property>
这个参数配置在作怪。
参数hibernate.hbm2ddl.auto解释:
hibernate.hbm2ddl.auto Automatically validate or export schema DDL to the database when the SessionFactory is created. With create-drop, the database schema will be dropped when the SessionFactory is closed explicitly. eg. validate | update | create | create-drop
这个参数的作用:自动创建|更新|验证数据库表结构。如果不是此方面的需求建议set value="none"。
PS:如果不是用于开发或特殊需求,不要随便使用该参数。