Re: Question about EOs and their lifespan/uniqueness
Re: Question about EOs and their lifespan/uniqueness
- Subject: Re: Question about EOs and their lifespan/uniqueness
- From: Chuck Hill <email@hidden>
- Date: Mon, 5 Nov 2007 12:26:39 -0800
On Nov 5, 2007, at 12:14 PM, Kevin Windham wrote:
I am running into a problem that I think may be related to the way
EOs are created/managed in memory. I have an object that I pass in
to a component. That object has some boolean variables that are not
backed by the DB. They are simply declared in the class file,
public boolean boolvar;
If I set this variable and then display the page with a checkbox
bound to this variable it shows the correct state. If I leave the
page and go back to it then the state of the checkbox always
reverts to false.
It seems like I am getting a newly created object instead of the
one that was already created.
That is what it sounds like to me as well.
Other variables that are DB backed seem fine. Is this normal? Do
EOs get created and destroyed regularly, and can I not rely on
getting the same object instance if one was already fetched and
created in memory? Or, am I barking up the wrong tree and something
else is going on?
Each editing context gets its own instance (as in Java object
instance) of the EO. If you only use one editing context you will
see that the value is maintained. The other options is to use some
sort of notification scheme to synchronize these values across all
instances of the EO.
Chuck
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden