It looks like your attribute 'attrdetails' is mapped as LAZY one and that you use session-per-business transaction pattern (Maybe under the cover, if that is Springs Hibernate wrapper then please stop using it ASAP. ).
If my assumptions are correct then:
in session 1 (read) you have got object that has proxy for attrdetails, not the details. Then method was finished and session got closed.
then session 2 tries to investigate if it needs to preserve attrdetails, and attrdetails proxy tries to use its session reference(to session 1) to get the actual details. Well, at this moment the first session is long gone, hence the exception.
Fixes:
- map attrdetails as eager;
- have read and update as part of one transaction;
_________________ --------------
Konstantin
SourceLabs - dependable OpenSource systems
|