Reputation: 1142
I use embedded H2 Database in Java SE project (jdbc:h2:file:...) with JPA 2.0 (EclipseLink 2.1.1). I set also set MODE=Derby in jdbc url connection. Everything worked perfect till I added some new entities and tried to persist them. I'm getting StackOverflowError :( I guess it's connected with h2 database file optimization/compacting/??? process, because file size is growing huge (should be ~1MB but it's 60MB and 40MB temp file). The question is - what is going on and how can I turn it off? db file is corrupted due to StackOverflowError :]
Thanks for any help!
Upvotes: 3
Views: 1534
Reputation: 64632
Infinite recursion is the cause. You'll have to find it. AOP can be used to intercept and log every method invocation. When recursion starts you'll be able to notice a pattern of repeated method invocations which will luckily lead you to the one calling itself.
Upvotes: 4