A while ago, we fixed a really annoying defect in our code. Because we debugged for days without finding the reason for the defect, I want to share how we approached the problem and what the solution was. The breakthrough in this problem came when a colleague of mine reviewed our code and found a solution. So the first thing to take away here is: If you tried anything, ask a coworker to join you in the bug-hunt.
Our application has an HSQL database and uses Spring Data with Hibernate. Really early in the development, we encountered the following exception: