gpt4 book ai didi

hibernate - 运行应用程序出现Grails 2.4和hibernate4错误

转载 作者:行者123 更新时间:2023-12-02 16:02:09 25 4
gpt4 key购买 nike

我已经将应用程序升级到Grails 2.4.0,并且正在使用hibernate4插件。执行运行应用程序时,使用内存数据库为每个域类生成以下错误示例。我已经在休眠论坛上阅读了几则帖子,这些错误并不严重。它只是在记录错误,因为它要删除的表尚不存在。

2014-Mai-24 13:25:26,788 ERROR [localhost-startStop-1] org.hibernate.tool.hbm2ddl.SchemaExport - SchemaExport.java 425 - HHH000389: Unsuccessful: alter table user_role drop constraint FK_apcc8lxk2xnug8377fatvbn04 if exists

2014-Mai-24 13:25:26,789 ERROR [localhost-startStop-1] org.hibernate.tool.hbm2ddl.SchemaExport - SchemaExport.java 426 - Table "USER_ROLE" not found; SQL statement:alter table user_role drop constraint FK_apcc8lxk2xnug8377fatvbn04 if exists [42102-173]


有谁知道如何制止测井噪声?

最佳答案

这是一个错误,看来您可以那样做,不会造成任何问题,但是,如果您不想看到此消息,则可以找到一些解决方案:(编辑:选项2似乎工作得更好(请参阅本文中的评论) ))

1.-来自DataSource.groovy的singleSession配置

https://jira.grails.org/browse/GRAILS-11198

2.-覆盖H2方言:

public class ImprovedH2Dialect extends H2Dialect {
@Override
public String getDropSequenceString(String sequenceName) {
// Adding the "if exists" clause to avoid warnings
return "drop sequence if exists " + sequenceName;
}

@Override
public boolean dropConstraints() {
// We don't need to drop constraints before dropping tables, that just
// leads to error messages about missing tables when we don't have a
// schema in the database
return false;
}
}

Unsuccessful: alter table XXX drop constraint YYY in Hibernate/JPA/HSQLDB standalone

关于hibernate - 运行应用程序出现Grails 2.4和hibernate4错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29462870/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com