Also the EOModel checks are only enforced when saveChanges() runs.  So it is 
possible that a bug in your code is setting these to null before you try to use 
them. 

Chuck


On 2012-11-14, at 9:16 AM, Ramsey Gurley wrote:

> 
> 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      (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net
> 
> This email sent to ch...@global-village.net

-- 
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.    
http://www.global-village.net/gvc/practical_webobjects

Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing 
Companies in B.C! 
Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of 
Canada’s Fastest-Growing Companies by PROFIT Magazine!









 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to