-->
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.  [ 4 posts ] 
Author Message
 Post subject: My Stoopid composite-id and parent child problem... Hangs
PostPosted: Sat Jun 17, 2006 4:20 am 
Newbie

Joined: Thu Jun 15, 2006 6:46 am
Posts: 5
Hello, I'm pullin my hair out here. I've used Hibernate with java for a couple of projects. I've kept to the simple stuff and it's been a joy. I'm now using NHibernate with Dot Net, but on legacy databases. I have a parent child relationship I need to model,,, this is the schema (some irrevant bist cut out

<?xml version="1.0"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<!--<hibernate-mapping package="dsys.prototype.efr2.gen" auto-import="false">//-->

<class name="EFR2Objects.FeeRendHeader,EFR2" table="FEEREND" lazy="false">


<composite-id name="FeeRendHeaderId" class="EFR2Objects.FeeRendHeaderId,EFR2">

<key-property name="AdvCode" type="string">
<column name="ADVCODE"/>
</key-property>

<key-property name="RendUrn" type="int">
<column name="REND_URN"/>
</key-property>

</composite-id>

<property name="Pk" type="int" column="pri_key" update="false" />

<property name="RendType" type="Char" column="REND_TYPE" not-null="false"/>
<property name="RendUser" type="string" column="REND_USER" not-null="false"/>


<property name="RendUrn" type="int" column="REND_URN" not-null="false"
update="false" insert="false"/>

<property name="Status" type="Char" column="REND_STATUS" not-null="false"/>

<property name="DateStamp" type="string" column="DATE_STAMP" not-null="false"/>
<property name="ProcessedDateStamp" type="string" column="PROCESSED" not-null="false"/>
<property name="ProcessorName" type="string" column="PROCESSOR" not-null="false"/>


<property name="Uid" type="string" column="UID" not-null="false"/>


<property name="AdvCode" type="string" column="ADVCODE" not-null="false"
insert="false" update="false"/>


<property name="AdvName" type="string" column="ADVNAME" not-null="false"/>

:
: various other string etc properties
:

<list name="Items"
lazy="false"
inverse="true"
cascade="all">
<key>
<column name="ADVCODE" />
<column name="REND_URN"/>
</key>
<index column="ITEM_LN" type="int"/>
<one-to-many class="EFR2Objects.FeeRendLine,EFR2"/>
</list>

</class>


<class name="EFR2Objects.FeeRendLine, EFR2"
table="FEERDLN" lazy="false" >

<composite-id class="EFR2Objects.FeeRendLineId,EFR2"
name="FeeRendLineId" >
<key-many-to-one class="EFR2Objects.FeeRendHeader,EFR2"
name="FeeNote" >
<column name="ADVCODE" />
<column name="REND_URN" />
</key-many-to-one>

<key-property name="ItemLine" type="int" column="ITEM_LN"/>
</composite-id>

<property name="ItemLine" type="int" column="ITEM_LN" update="false" insert="false"/>
<property name="Pk" type="int" column="pri_key" />
<property name="ItemDesc" type="string" column="ITEM_DESC"/>
<property name="ItemDate" type="string" column="ITEM_DT"/>
<property name="ItemVal" type="double" column="ITEM_VAL"/>

</class>


</hibernate-mapping>


My problem is when I query the FeeRendHeader, I use session.Load(...) the app just hangs around... I've used Load in Java and it worked fine. I am thinking that my mapping is causing some kind of recursive SQL query to busy the server... I'm not 100 sure, but If I turn ON lazy in the parent Items list it returns just fine, but I get no child records...
Any suggestion welcomed or even someway for me to track whats going on would be helpful...
Help!!!!!!

_________________
I'm addicted to VBoost...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 17, 2006 6:37 pm 
Senior
Senior

Joined: Sun Jun 04, 2006 1:58 am
Posts: 136
1.try turning on show_sql.
2. Make sure there are no row locks on the data you are trying to access.
There are many dba tools out there which can tell you that.

_________________
Don't forget to rate


Top
 Profile  
 
 Post subject: Tried show_sql
PostPosted: Sun Jun 18, 2006 4:42 am 
Newbie

Joined: Thu Jun 15, 2006 6:46 am
Posts: 5
Tried show_sql and it looks like NHibernate is issuing hundreds of selects on the 'parent', then the child, then the parent, child etc tables... this is what I was wondering... is my mapping causing a recursive loop here?

I definately think my mapping is the cause!!!

Any help on the mapping really appreciated... HELP!!!

_________________
I'm addicted to VBoost...


Top
 Profile  
 
 Post subject: ...
PostPosted: Mon Jun 19, 2006 1:30 pm 
Newbie

Joined: Thu Jun 15, 2006 6:46 am
Posts: 5
I also need to ensure the ITEM_LN column I'm using as an Index starts from 1 to N and not from 0... I've searched this forum and can find other people requesting an offset attribute,,, but couldn';t this be done in an onLoad on onSave event ???

Thanks!!!

_________________
I'm addicted to VBoost...


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