i've been struggling with this for hours
as it is, the test runs ok:
and runs ok in either cases: closing or not session at the end of persistence method:
now lets comment these two lines:
well, i get the error: this probably deals with database identity versus object identity
ok
my reasoning is the one i tried to say in comments: problem is tied with the rithm of open-closing of session, except when an object is loaded from db!
solutions:
- uncomment again and use it instead o previous code, using it as a barrier
- not closing session in persistence classes
- closing session in persistence classes and
- using s.clear()
or
- HibernateUtil.closeSession() followed by HibernateUtil.getSession()
speaking franlky: i dont get it
[ March 27, 2005: Message edited by: miguel lisboa ]
as it is, the test runs ok:
and runs ok in either cases: closing or not session at the end of persistence method:
now lets comment these two lines:
well, i get the error: this probably deals with database identity versus object identity
ok
my reasoning is the one i tried to say in comments: problem is tied with the rithm of open-closing of session, except when an object is loaded from db!
solutions:
- uncomment again and use it instead o previous code, using it as a barrier
- not closing session in persistence classes
- closing session in persistence classes and
- using s.clear()
or
- HibernateUtil.closeSession() followed by HibernateUtil.getSession()
speaking franlky: i dont get it
[ March 27, 2005: Message edited by: miguel lisboa ]