Sorry, the other 2 tests in the class close the sessions before doing the lazy loading. The test in question clears the session, but leaves it open.
In the case of a cleared session, the session is still open and still known to the lazy entity/collection, so that session (and any transactional context) is used.
That's what I would have thought, but it's not what I'm seeing. When the session is cleared, StatefulPersistenceContext#clear unsets the session from the collections (and therefore a temporary session is created). Is that expected, or could we leave the original session alone?
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
Sorry, the other 2 tests in the class close the sessions before doing the lazy loading. The test in question clears the session, but leaves it open.
That's what I would have thought, but it's not what I'm seeing. When the session is cleared, StatefulPersistenceContext#clear unsets the session from the collections (and therefore a temporary session is created). Is that expected, or could we leave the original session alone?