在我的 JUNIT 和 Hibernate (hibernate-core-3.6.8.Final) 环境中使用带有嵌入式驱动程序 (derby-10.9.1.0) 和内存数据库的 Derby 时,我遇到了麻烦。
我正在使用注释并使用 hbm2ddl 创建我的内存数据库。
一切正常,除非我尝试使用序列。
该序列已创建(它出现在日志中),但是当我尝试添加一个具有与该序列相关的 PK 的实体(休眠)时,我的代码开始在每一行中写入一个无限循环:
Hibernate: values next value for app.SE_FERI
我的数据库创建为:
jdbc:derby:memory:testdb;create=true
在使用数据库之前,我在代码中使用 hbm2ddl,如下所示:
SchemaExport schemaExport = new SchemaExport(config);
schemaExport.drop(true, true);
schemaExport.create(true, true);
一些帮助 !?