-->
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: Understanding initialization
PostPosted: Fri Jan 26, 2007 8:50 am 
Beginner
Beginner

Joined: Sat Dec 16, 2006 1:52 pm
Posts: 40
I wish there was a FAQ somewhere that explained when objects were initialized. I am totally baffled as 90% of my objects always return true for isInitialized, then I have a few that return false.

I am using some lazy collections, but it seems as if just asking isInitialized is causing them to be initialized? Furthermore, do I ask if my object is initialized, or should I be asking if the objects collection is initialized? I am lost there two so I ask for both the object and the collection it holds. So I have a jumbo almost recursive method that initializes everything but usually does nothing because most objects are either already initialized, or get initialized as soon as I pass them to 'isInitialized.'

Exactly what is a candidate for initialization? is it the object, or is it the reference held by another object? For example
Code:
class One{
    List l;
    B b;
}
class B {
    List x;
}



Which of these make sense? And under what conditions? proxy/noproxy/lazy collection/eager collection? The only one that ever shows need for initialization to me is "D"

One object = getOne();
A. isInitialized(object);
B. isInitialized(object.l);
C. isInitialized(object.b);
D. isInitialized(object.b.x);


Thanks. As it stands, even calling 'initialize' has not been sufficient to ensure my objects/collections are all loaded, but maybe I just missed a few!?


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.