-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: lazy loading problem with hibernate 3.2.0
PostPosted: Wed Apr 25, 2007 7:28 am 
Newbie

Joined: Wed Apr 25, 2007 6:38 am
Posts: 1
Location: Egypt
I work with hibernate 3.2.0 and i faced the following problem

Probleme environment
--3 persisted classes(p1, p2 and p3) with the following relations
--p1 one-to-many p2 one-to-many p3 [p1 many-many p3] with lazy loading
, save-update cascade style and bidirectional navigation using maps in the one-side with the many-side id as the map key

Problem case
--loading a persisted instanse of p1, so we have a persisted map of p2(proxy) then trying to put a new entry of p3 in it's many side of p2 and finally updatting the p2 instanse hoping hibernate to cascade the process and saves the new p3 instanse.
--After debugging i found that hibernate at the line of insertion of new p3 instanse only initializes the p2 instanse and cancells the insertion as follow

P1 p1 = (P1) session.get(P1.class, p1Id);
P3 p3 = new P3();
p1.getP2(p2Id).getP3.put(p3.getId(), p3); //Map<pId, p>
session.update(p2);

--Hibernates ignores the puttting of p3 in p2

--In Hibernate 3.2.3 this problem solved, so i want a solution without changing my hibernate version.if any exists


thank you


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.