-->
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: Many-to-many mapping: collection was not processed by Flush
PostPosted: Mon May 23, 2005 8:13 am 
Mapping:

Code:
<class name="party_info, model"
            discriminator-value="~party"
            table="portal_parties">

        <id name="party_id" access="property" column="party_id" unsaved-value="-1">
            <generator class="identity" />
        </id>

        <discriminator column="party_type" type="string" />

        <subclass name="user_group_info, model"
                discriminator-value="group">

            <set name="hb_users" table="..." access="property" cascade="none" lazy="true">
                <key column="group_id"/>
                <many-to-many class="user_identity, model" column="user_id"/>
            </set>

        </subclass>

        <subclass name="user_identity,model"
                discriminator-value="~user">       

            <set name="hb_user_groups" table="..." access="property" inverse="true" cascade="none" lazy="true">
                <key column="user_id"/>
                <many-to-many class="user_group_info, model" column="group_id"/>
            </set>         
        </subclass>

    </class>



i'm load user_group, claer users, and fill new user list:


Code:
                user_identity u1 = users.get_user( "Jeff" );
                user_identity u2 = users.get_user( "Kelly" );
                user_identity u3 = users.get_user( "Joe" );
                user_group_info ug = user_groups.get_user_group( "Management" );
                user_info_collection u = new user_info_collection();
                u.Add( u1 );
                u.Add( u2 );
                u.Add( u3 );
               
                using ( hibernate_transaction tr = new hibernate_transaction( connection_scope.current.hibernate_session ) )
                    {
                    ug.users.Clear();
                    ug.users.AddAll(u);
                    tr.Commit();
                    }


get assertion:

NHibernate.AssertionFailure : collection was not processed by Flush()

what's wrong?


Top
  
 
 Post subject:
PostPosted: Tue May 24, 2005 3:32 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
AssertionFailure most probably means a bug in NHibernate, can you create an easily-reproducible test case and add it to JIRA?


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 24, 2005 5:36 am 
yes, in 1-2 days


Top
  
 
 Post subject:
PostPosted: Wed May 25, 2005 6:19 am 
While test case creating some comments:

- prorably problem in SessionImpl.FlushCollections method
- when some collections processed, new collections created by lazy loading.
- Also it seem that code:
Code:
foreach( DictionaryEntry me in IdentityMap.ConcurrentEntries( collectionEntries ) )

fix list of collections must be processed before it's realy processing
so if new collection appears in this foreach block - it's not to be processed.


Top
  
 
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.