I have some named queries :
cable.list cable.list.building
cable has a child object "coordinate". In order to handle for coordinate to insert/update/select to/from database , I have used sqlInsert, sqlUpdate and loader,(NamedNativeSqlQuery).
Cable coordinate (Loader, sqlinsert, sqlupdate,) building (jpa annotations, lazy loading)
when I try to call local.findByNamedQuery(cable.list), everything works fine : ((But query is too slow. Because of this slowness I used detached criteria, and the performace improved.))
But when I try to call local.findByNamedQuery(cable.list.building), I get "proxy handle is no longer valid" exception. Hibernate executes the first query in success, but when executing the second query to get coordinate (I see in the log file that the sql is the one which I written by NamedNativeSqlQuery with loader.), it fails and throws that exception.
Can anyone help me on this issue? Thank you for your help in advance.
|