德比序列循环在junit测试中 [英] Derby Sequence Loop in junit test
问题描述
$ b
我使用注释并使用hbm2ddl来创建我的内存数据库。
除了当我尝试使用序列。创建序列(它出现在日志中),但是当我尝试添加一个与该序列相关的PK实体(hibernate)时,我的代码启动了一个无限循环写入每行:
Hibernate:值为app.SE_FERI的下一个值
我的数据库创建为:
jdbc :derby:memory:testdb; create = true
我在代码中使用hbm2ddl,数据库使用,如:
$ b $ pre $ $ $ c $ SchemaExport schemaExport = new SchemaExport(config);
schemaExport.drop(true,true);
schemaExport.create(true,true);
有些帮助!?
当序列的allocationSize设置为1时,会发生此问题。将它设置为大于1的值适用于我。
我知道这个线程是有点老,但如果任何人有这个问题,这可能是解决方案。
编辑:拼写
I'm in trouble when using Derby with embedded driver (derby-10.9.1.0) and in-memory db in my JUNIT with Hibernate (hibernate-core-3.6.8.Final) environment.
I'm using annotations and using hbm2ddl to create my in-memory db.
Everything is working except when I try to use an sequence.
The sequence is created (it appears in the log), but when I try to add one entity (hibernate) with PK related to that sequence my code starts a infinite loop writing in each line:
Hibernate: values next value for app.SE_FERI
My db is created as:
jdbc:derby:memory:testdb;create=true
I'm using hbm2ddl inside my code, before the database use, as:
SchemaExport schemaExport = new SchemaExport(config);
schemaExport.drop(true, true);
schemaExport.create(true, true);
Some help !?
This problem occurres when the allocationSize of the sequence is set to 1. Setting it to a value > 1 worked for me.
I know this thread is kinda old, but if anybody else has this problem, this could be the solution.
Edit: spelling
这篇关于德比序列循环在junit测试中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!