• 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 on non-null attribute
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NullPointerException on non-null attribute


  • Subject: Re: NullPointerException on non-null attribute
  • From: Ramsey Gurley <email@hidden>
  • Date: Wed, 14 Nov 2012 10:16:02 -0700

On Nov 14, 2012, at 8:54 AM, Maik Musall wrote:

> Hi,
>
> occasionally I get a NullPointerException on an attribute of a fetched EO that is
> * set to not nullable in EOModel
> * guarded to be not null by a NOT NULL constraint in the database
> * and actually has a value there.
>
> This happens with both simple values like BigDecimals, as well as with relationships.
>
> Any idea what could cause that or what I could do to nail it down?
>
> Thanks
> Maik

I have seen that in apps that violate the commandments:

http://wiki.wocommunity.org/pages/viewpage.action?pageId=1050329

If relationships are going missing and you are using nested ECs you may want to try

ec.setRetainsRegisteredObjects(true)

There's a known bug where EOs can be GCed which can result in nulls coming from required relationships. Nobody has managed to fix it in wonder yet.

Ramsey
 _______________________________________________
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: NullPointerException on non-null attribute
      • From: Chuck Hill <email@hidden>
References: 
 >NullPointerException on non-null attribute (From: Maik Musall <email@hidden>)

  • Prev by Date: Re: NullPointerException on non-null attribute
  • Next by Date: Re: NullPointerException on non-null attribute
  • Previous by thread: Re: NullPointerException on non-null attribute
  • Next by thread: Re: NullPointerException on non-null attribute
  • Index(es):
    • Date
    • Thread