-->
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: Lazyinitializa Exception: when add new element to empt list
PostPosted: Wed Sep 21, 2011 12:21 pm 
Newbie

Joined: Wed Sep 21, 2011 12:04 pm
Posts: 1
Hello friends,

I am stuck with this issue. The problem is when an empty collection is returned by hibernate and I try to add a new element to it, hibernate raises the error "collection is not associated with any session". But when this collection has one or more elements then hibernate allows me to add new element.

<class name = "Organisation" schema="dbo" table="ORGANISATION_ELEMENT">

<set inverse="true" name="children" cascade="all" lazy="extra"
order-by="NAME asc">
<key column="P_SERIAL" update="true"/>
<one-to-many class="Organisation" />
</set>

</class>

Also can anyone tell me that whether hibernate maintain reference to the object of empty list in session.

Looking forward for your replies.

Regards
Mansoor


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.