开发者

Warning when using Apache Derby in memory

I have a number of unit tests, which use Apache Derby in memory. My connection url is: jdbc:derby:memory:srf.derby;create=true

I discovered that each time, when a method marked开发者_开发知识库 as @Transactional is finishing, I receive a Derby warning

12:53:28:5328 [org.hibernate.util.JDBCExceptionReporter] [main] WARN  - SQL Warning: 10000, SQLState: 01J01
12:53:28:5328 [org.hibernate.util.JDBCExceptionReporter] [main] WARN  - Database 'memory:srf.derby' not created, connection made to existing database instead.

Why is it? What I'm doing wrong?

Thank you


You're not doing anything wrong. You're passing ';create=true' each time, but the database is only created the first time your program accesses it. Since it's in-memory, the database then hangs around until your program exits, at which point it disappears.

You could avoid the warning by passing ';create=true' only on the first test in your test suite, and then subsequent tests do not need to pass that value.

Or, you could just not worry about the warning.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜