• 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
Re: first time relationship problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: first time relationship problem


  • Subject: Re: first time relationship problem
  • From: Ken Anderson <email@hidden>
  • Date: Thu, 2 Aug 2007 10:44:07 -0400

You saved the changes, therefore delete 'theSection', but then you tried to access 'theSection'. You should move the removeObject... line to above the deleteObject line.

On Aug 2, 2007, at 10:40 AM, Theodore Petrosky wrote:

I am relatively new to WO.. I finally put together a
web application (internal to the company) that is not
very big.

I am using the examples in the Marker book to create a
to-many relationship. (publications have sections). I

 I just implemented a removeSection action with this
code:

    public WOComponent deleteSection() {
//		System.out.println("deleting a row!");

session().defaultEditingContext().deleteObject(theSection);
		session().defaultEditingContext().saveChanges();

publication.removeObjectFromBothSidesOfRelationshipWithKey(theSection,
"sectionss");
        return null;
    }

everything is fine so far.. except if I try to add a
new section object. my app crashes.

this is the top of the error log:

java.lang.IllegalStateException: Cannot obtain
globalId for an object which is not registered in any
editingContextobject: {values = {sectiontrim = ;
sectioncomment = ; sectiontitle = "aaaaaa";
sectionbleed = ; sectionsafety = ; }; this = ""; },
databaseContext:
com.webobjects.eoaccess.EODatabaseContext@e36ec6,
object's editingContext: null, databaseContext's
active editingContext:
com.webobjects.eocontrol.EOEditingContext@f68336


Should I be 'clearing' the editingContext? What am I missing in the logic of WebObjects?

Ted




______________________________________________________________________ ______________
Shape Yahoo! in your own image. Join our Network Research Panel today! http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40anderhome.com


This email sent to email@hidden

_______________________________________________ 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
References: 
 >first time relationship problem (From: Theodore Petrosky <email@hidden>)

  • Prev by Date: first time relationship problem
  • Next by Date: RE: Concurrency question
  • Previous by thread: first time relationship problem
  • Next by thread: Re: first time relationship problem
  • Index(es):
    • Date
    • Thread