-->
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.  [ 3 posts ] 
Author Message
 Post subject: Many-To-one stackoverflowexception
PostPosted: Wed May 03, 2006 11:04 am 
Beginner
Beginner

Joined: Tue Sep 14, 2004 1:03 pm
Posts: 33
Location: Calgary, Alberta Canada
I keep getting a StackOverflowException when trying to save a region object. Doesn't matter if lazy is true or false. or if an inregion is provided or not. I've seen similar post but no replies. Any suggestions or help is appriciated.

NHibernate version:1.0.2

Mapping documents:

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="EDMS.Domain.Region, EDMS.Domain"
table="CORE.REGIONS">
<id name="RegionID"
column="REGION_ID"
type="System.Int32"
unsaved-value="0">
<generator class="identity" />
</id>
<property name="Name"
column="NAME"
type="System.String"
not-null="true"
length="50"
unique="false" />
<property name="Description"
column="DESCRIPTION"
type="System.String"
not-null="false"
length="250"
unique="false" />
<property name="RowGuid"
column="ROWGUID"
type="System.Guid"
not-null="false"
unique="true" />
<many-to-one name="Type"
column="TYPE_ID"
not-null="true"
class="EDMS.Domain.RegionType, EDMS.Domain"
unique="false"
outer-join="true"/>
<many-to-one name="InRegion"
column="IN_REGION"
not-null="false"
class="EDMS.Domain.Region, EDMS.Domain"
unique="false"
cascade="none"
outer-join="false"/>
</class>
<class name="EDMS.Domain.RegionType, EDMS.Domain"
table="CORE.REGION_TYPES">
<id name="TypeID"
column="TYPE_ID"
type="System.String"
length="5">
<generator class="assigned" />
</id>
<property name="Name"
column="NAME"
type="System.String"
not-null="true"
length="35"
unique="false" />
<property name="Description"
column="DESCRIPTION"
type="System.String"
length="250"
not-null="false"
unique="false" />
</class>
</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():
s.Save(obj);


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 03, 2006 11:22 am 
Expert
Expert

Joined: Tue Aug 23, 2005 5:52 am
Posts: 335
It's probably not in the NHibernate code, but the getters and setters of your object.

I've seen this when I have the getter/setter referring to itself rather than the internal field being used for NHibernate. (oops!)

Check your class for this one.

Cheers,

Symon.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 03, 2006 1:57 pm 
Beginner
Beginner

Joined: Tue Sep 14, 2004 1:03 pm
Posts: 33
Location: Calgary, Alberta Canada
Found the problem. My base classes were OK. The problem involved a generics issue. Anyway unrelated to NHibernate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.