How to correctly share objects
How to correctly share objects
- Subject: How to correctly share objects
- From: Randy Wigginton <email@hidden>
- Date: Fri, 24 Feb 2006 07:07:36 -0800
Hello all, I thought I knew how to do this, but apparently I am
mistaken.
I have a schema that has a couple of tables with extremely common
objects. These tables usually have two columns, id and meaning; as
an example, I might have three entries, one for "Enabled", another
"Disabled", and "Missing". When my app starts up I load all objects
from the DB and store the objects in a hash map for easy retrieval
later. In the EOModel, I specify to share all objects.
When I am creating new objects in other tables that refer to this
table, I simply add the shared object to the main object:
MyFoo f = new Foo();
f.setStatus(sharedObject);
ec.insertObject(f);
ec.saveChanges();
Everything works fine for a while. However, eventually I get an
error message (Sorry I don't have the exact text) to the effect that
the object is no longer available or is not on the DB.
What am I doing wrong? This has worked previously for me.
_______________________________________________
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