I had the same problem using Hibernate 4.1.x and I wanted to point a pointer to someone experiencing the same problem. In my case, as mentioned in previous comments, this is not the entity itself, but rather another entity referenced by the loaded object. The strange thing was that this reference object did exist, but it was accessed in another transaction / session, and that mattered. Since I wrote a test using spring, simply changing the @transactional move from class level to method completely broke everything.
source share