Hi Bruce,

I have the same kind of relationship in the following example, and here it
works:


<mapping>
        <class name="FolderBean" identity="id" key-generator="MAX">
                <description>Folder</description>
                <map-to table="folder"/>
                <field name="id" type="integer">
                        <sql name="folderId" type="integer"/>
                </field>
                <field name="name" type="string">
                        <sql name="name" type="char"/>
                </field>
                <field name="deletable" type="boolean">
                        <sql name="isDeletable" type="char[01]"/>
                </field>
                <field name="parentFolder" type="FolderBean">
                        <sql name="parentFolderId"/>
                </field>
                <field name="topFolder" type="FolderBean">
                        <sql name="topFolderId"/>
                </field>
                <field name="childFolders" type="FolderBean"
collection="vector">
                        <sql many-key="parentFolderId"/>
                </field>
                <field name="folderMapping" type="FolderMappingBean">
                        <sql name="folderMappingId"/>
                </field>
        </class>
</mapping>


Where is the difference to the FolderMappingBean?

Thanks,

Silvio




> -----Original Message-----
> From: Bruce Snyder [mailto:[EMAIL PROTECTED]]
> Sent: 21 January 2003 00:35
> To: [EMAIL PROTECTED]
> Subject: Re: [castor-dev] StackOverflowException
> 
> 
> This one time, at band camp, Silvio Katzan said:
> 
> SK>I upgraded to 0.9.4.1 from 0.9.3.21.
> SK>Using 0.9.4.1 I get a StackOverflowException on creating some 
> objects, this
> SK>is because there is an infinite loop in ClassMolder.getPriority()
> SK>Using 0.9.3.21 I didn't get the error.
> SK>
> SK>Comparing the two classes, the following line is commented out:
> SK>
> SK>line 627:          && _fhs[i].getEnclosingClassMolder() != this
> SK>
> SK>
> SK>Here are my example data:
> SK>
> SK><mapping>
> SK>   <class name="UserBean" identity="id" key-generator="MAX">
> SK>           <description>user</description>
> SK>           <map-to table="person" xml="person"/>
> SK>           <field name="id" type="integer">
> SK>                   <sql name="userId" type="integer"/>
> SK>           </field>
> SK>           <field name="folderMappings" type="FolderMappingBean"
> SK>collection="vector">
> SK>                   <sql many-key="userId"/>
> SK>           </field>
> SK>   </class>
> SK>   <class name="FolderMappingBean" identity="id" key-generator="MAX">
> SK>           <description>Mapping from user to folder with
> SK>type</description>
> SK>           <map-to table="folderMapping"/>
> SK>           <field name="id" type="integer">
> SK>                   <sql name="folderMappingId" type="integer"/>
> SK>           </field>
> SK>           <field name="folder" type="FolderBean">
> SK>                   <sql name="folderId"/>
> SK>           </field>
> SK>           <field name="user" type="UserBean">
> SK>                   <sql name="userId"/>
> SK>           </field>
> SK>           <field name="childFolderMappings" type="FolderMappingBean"
> SK>collection="vector">
> SK>                   <sql many-key="parentFolderMappingId"/>
> SK>           </field>
> SK>           <field name="parentFolderMapping" type="FolderMappingBean">
> SK>                   <sql name="parentFolderMappingId"/>
> SK>           </field>
> SK>   </class>
> SK></mapping>
> SK>
> SK>
> SK>And here the sequence of creating objects:
> SK>
> SK>- first the user is loaded into the current transaction
> SK>- then the constructor of FolderMappingBean is called
> SK>- Construtctor of FolderMapping:
> SK>   public FolderMappingBean(Database pDatabase, UserBean pUser,
> SK>FolderMappingBean pParentFolderMapping)
> SK>   {
> SK>           mChildFolderMappings = new Vector();
> SK>           mParentFolderMapping = null;
> SK>           mUser = null;
> SK>           
> SK>           pDatabase.create(this);
> SK>           
> SK>           pUser.addFolderMapping(this);
> SK>           
> SK>           if(pParentFolderMapping != null)
> SK>           {
> SK>                   pParentFolderMapping.addChildFolderMapping(this);
> SK>           }
> SK>   }
> SK>
> SK>If pDatabase.create(this) is called, I get the StackOverflow Error.
> 
> Silvio,
> 
> I just commented on this in the bug report. Please see the 
> following URL for
> my comments: 
> 
>     http://bugzilla.exolab.org/show_bug.cgi?id=1179
> 
> Bruce
> -- 
> perl -e 'print 
> unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
> 
> ----------------------------------------------------------- 
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev
> 

<<attachment: winmail.dat>>

Reply via email to