-->
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.  [ 1 post ] 
Author Message
 Post subject: Fieldvalue lost while Lazy loading is active
PostPosted: Wed Jan 10, 2007 5:49 am 
Newbie

Joined: Mon Oct 09, 2006 2:50 pm
Posts: 15
Hello,

I'm using NHibernate 1.2Beta2.

I have a class User and a class UserGroup (lazy loading is active everywhere) and the classes are linked with a manytomany assoc.:

Code:
class User
{
    public virtual void AddUserGroup(UserGroup ug)
    {
        // ug.bMyField -> is true (can see in debuggerview)
        // inside the AddUser-Method the field is false (default(bool))
        ug.AddUser(u);
        // ug.bMyField -> is true
    }
}

class UserGroup
{
    private bool bMyField;

    public virtual void AddUser(User u)
    {
        // this.bMyField -> is false
    }
}


As you can see in the comments in this code-snippet (in the real code I have the add-logic and checking for contains etc... [don't needed here for understanding my problem]) the value of the field bMyField is "lost".

When I turn lazyloading off for the manytomany-assoc. all is fine. WHY? I need lazy loading...

Hope understanding me (sorry for my bad english).

Greetings,
Ramon


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

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.