-->
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.  [ 2 posts ] 
Author Message
 Post subject: Illegal attempt to associate a collection with two open sess
PostPosted: Thu Dec 11, 2008 3:21 pm 
Newbie

Joined: Tue Nov 18, 2008 11:16 am
Posts: 19
i get this exception: Illegal attempt to associate a collection with two open session


i want to delete a parent with its children. to delete a child only works great.
i have try to search but cant find anything that works for me. this is my mapping.

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly=".Core" namespace="Core">
<class name="Core.Domain.TakeAwayCategory" table="TakeAwayCategoryTbl">
<id name="Id" column="id" unsaved-value="0">
<generator class="native"></generator>
</id>
<property name="Name" column="name" />
<bag name="TakeAwayDishes" generic="true" cascade="all" inverse="true">
<key column="category_id" />
<one-to-many class="Core.Domain.TakeAwayDish" />
</bag>
</class>
</hibernate-mapping>

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Core" namespace="Core">
<class name="Core.Domain.TakeAwayDish" table="TakeAwayDishTbl">
<id name="Id" column="id" unsaved-value="0">
<generator class="native"></generator>
</id>
<property name="Description" column="descr" />
<property name="Price" column="price" />
<property name="View" column="show" />
<property name="SortOrder" column="sortorder" />
<property name="KeyHole" column="keyhole" />
<many-to-one name="TakeAwayCategory" column="category_id" class="Core.Domain.TakeAwayCategory" />
</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2008 3:48 am 
Newbie

Joined: Tue Nov 18, 2008 11:16 am
Posts: 19
nevermind i solved it.. i did the misstake that i on the delete i send in the category object so before delete i did GetById(id); so there is my second session..


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

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.