Hello there,
from the moment I've switched to using a new OSC for my background thread ECs, I am occassionally getting weird NPEs, like e.g., this one:
===
Caused by: java.lang.NullPointerException
at com.webobjects.eocontrol.EOCustomObject.changesFromSnapshot(EOCustomObject.java:595)
at com.webobjects.eocontrol.EOCustomObject$changesFromSnapshot$6.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at com.webobjects.eocontrol.EOCustomObject$changesFromSnapshot$6.callCurrent(Unknown Source)
at cz.ocs.model.OCSEnterpriseObject.fixArchivedButReallyUnchangedItemsFromSnapshot(OCSEnterpriseObject.groovy:938)
at cz.ocs.model.OCSEnterpriseObject.validateForSave(OCSEnterpriseObject.groovy:980)
at com.webobjects.eocontrol.EOCustomObject.validateForUpdate(EOCustomObject.java:1446)
at er.extensions.eof.ERXGenericRecord.validateForUpdate(ERXGenericRecord.java:1215)
at com.webobjects.eocontrol.EOEditingContext.validateTable(EOEditingContext.java:2271)
at com.webobjects.eocontrol.EOEditingContext.validateChangesForSave(EOEditingContext.java:3020)
at com.webobjects.eocontrol.EOEditingContext._prepareForPushChanges(EOEditingContext.java:3249)
at com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3179)
at er.extensions.eof.ERXEC._saveChanges(ERXEC.java:1179)
at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:1102)
at er.extensions.eof.ERXEC$saveChanges$7.call(Unknown Source)
...
===
where my “validateForSave” and “fixArchivedButReallyUnchangedItemsFromSnapshot” looks like this:
===
void fixArchivedButReallyUnchangedItemsFromSnapshot {
NSDictionary ss=this.editingContext().committedSnapshotForObject(this)
NSDictionary d=this.changesFromSnapshot(ss) // <=== this is line 938 ===
if (d.count) ... blah blah ...
}
void validateForSave {
super.validateForSave()
fixArchivedButReallyUnchangedItemsFromSnapshot() // <=== this is line 980 ===