How can I simulate the ending of a transaction using JUnit with Spring and Hibernate to isolate a LazyInitializationException?

AbstractTransactionalJUnit4SpringContextTests is nothing more than a convenience for tests that want to do stuff inside a transaction. There's no reason why you can't take a more manual approach.

I've had success doing this in the past by getting access to the hiberate session and doing a manual .flush(); and .evict().

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions