Martin Marinschek wrote:
A very short hint from my side:
that exception means this object is not in the session anymore. You
can easily reapply it to the session by calling
session.update(object)
update is sort of problematic unless you really want to write
unless you do transactioning...
the better option would be to prefetch the affected parts
so that you do not run into lazy loading issues
over session boundaries.
To my experience, the OpenSessionInViewFilter, covers most problems in
these areas anyway because usually you only need the data you show or at
least reference in one form, in the next one, and fore the few
cases you do not need, a lazy false or object reload or bind does it.
the spring OpenSessionInViewFilterfilter has another nice sideeffect it
forces you to use dedicated transactions if you want to write, otherwise
it refuses to write.