• 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: NullPointerException only after first call to batchFetchRelationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NullPointerException only after first call to batchFetchRelationship


  • Subject: Re: NullPointerException only after first call to batchFetchRelationship
  • From: Kaj Hejer <email@hidden>
  • Date: Tue, 13 Jan 2004 22:37:01 +0100

Hi!

Thanks for answering and for this code! I will give this a try!

In the app where we got this exception we have only two pages where we create our own EOObjectStoreCoordinator and an ec with this as a parent because these two pages to heavy database stuff which block the app for other users.

All the other pages use session.defaultEditingContext or a childEC of this.

Would it then be ok to use the following in the constructor in Session.java:

    EOUtilities.modelGroup(defaultEditingContext()).loadAllModelObjects();

to get things correct Initialized? (ofcource except for those two pages where I use my own EOObjectStoreCoordinator... but in those pages I don't care yet since I havn't seen this issue there so far).

Do you think it is a bug in of that the reason this stuff not gets Initialized and we have to call loadAllModelObjects?


-Kaj :)



At 10:50 -0800 13-01-04, Chuck Hill wrote:
I had a perhaps similar problem which was caused by incomplete loading of EOModels when the first EOF operation was attempted. Try adding this to your constructor:
EOModelGroup.defaultGroup().loadAllModelObjects();


Note: defaultGroup() is not appropriate where using multiple EOF stacks. In that case create an ec in the stack and then use
EOUtilities.modelGroup(ec).loadAllModelObjects();


Chuck


Kaj Hejer wrote:

At 11:00 -0800 15-12-03, Chuck Hill wrote:

I also do a lot of batchFetchRelationship and have not seen this. Yet. We don't often use child EC's so that may explain it.

Strange, hard to reproduce, errors like this can be the result of an editing context processing notifications sent by another editing context. Tracking this down can be very difficult. I looked at the stack trace that Kaj posted but did not see any evidence of this. It looks like something in EODatabaseContext is hosed.




Hi!

Just fyi I now get the

[2004-01-13 13:51:24 MET] <WorkerThread6> java.lang.NullPointerException
at com.webobjects.eocontrol._EOMutableKnownKeyDictionary.<init>(_EOMutableKnownKeyDictionary.java:90)
at com.webobjects.eoaccess.EORelationship._foreignKeyForSourceRow(EORelationship.java:1094)



stacktrace when I don't use batchFetchRelationship.

We use prefetching in the fetch where I get this exception.

The ec here is session.defaultEditingContext.

See full stacktrace at http://folk.uio.no/kajh/tmp/wo20040113.txt



-Kaj :)


--

Chuck Hill                                 email@hidden
Global Village Consulting Inc.             http://www.global-village.net

Progress is the mother of all problems.
- G. K. Chesterton
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NullPointerException only after first call to batchFetchRelationship
      • From: Chuck Hill <email@hidden>
References: 
 >Re: NullPointerException only after first call to batchFetchRelationship (From: Kaj Hejer <email@hidden>)
 >Re: NullPointerException only after first call to batchFetchRelationship (From: Chuck Hill <email@hidden>)

  • Prev by Date: EOModeler Conceptual Question
  • Next by Date: Re: NullPointerException only after first call to batchFetchRelationship
  • Previous by thread: Re: NullPointerException only after first call to batchFetchRelationship
  • Next by thread: Re: NullPointerException only after first call to batchFetchRelationship
  • Index(es):
    • Date
    • Thread