• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to correctly share objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to correctly share objects
      • From: Art Isbell <email@hidden>
References: 
 >Re: EO Model (not the standalone EOModeler) in Xcode (From: Denis Stanton <email@hidden>)
 >Re: EO Model (not the standalone EOModeler) in Xcode (From: Ray Kiddy <email@hidden>)
 >Re: EO Model (not the standalone EOModeler) in Xcode (From: Robert Walker <email@hidden>)

  • Prev by Date: Re: EO Model (not the standalone EOModeler) in Xcode
  • Next by Date: RE: Shared EC problems for a newbie
  • Previous by thread: Re: EO Model (not the standalone EOModeler) in Xcode
  • Next by thread: Re: How to correctly share objects
  • Index(es):
    • Date
    • Thread