Re: NullPointerException on non-null attribute
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