|
Unfortunately, due to time constraints, we are unable to provide a test case. If I had only reported a failure but not the cause, I understand that a test case would be necessary. However, in this case, I am suggesting that a particular piece of code is wrong. I am wondering if the issue could be resolved by someone who undertands the method StatefulPersistenceContext.clear() looking at the code and evaluating whether or not it is correct?
After reading the code, and walking through it inside a debugger, it looks to me like the field nonlazyCollections should be cleared out before each query starts. This should happen in the constructor, which it does, and in the clear() method, which it does not. It seems to me that clear() should clear out the list nonlazyCollections, which it does not. When I used a debugger in this method on our server, the value of nonlazyCollections.size() was incremented by one after each query, even if clear() was called. Looking at the values of the individual elements in the list nonlazyCollections, all of them pointed to collections belongong to previous queries. At the time that the failure occurred in a SQL query, nonlazyCollections had a length of 146, which included references to many different collections belonging to many different objects from previous queries.
|