If so, how do I distinguish in my delegate method that „this is OK“ from the cases where there's something really amiss?
When using e.g., this code:
=== if I use this code ===
def gid=DBAuction._lastValidPOCacheGID[this.permanentGlobalID()]
println "???? about to get $gid of $this /EC:${this.editingContext().hashCode()}"
def lvpo=this.editingContext().faultForGlobalID(gid,this.editingContext())
println "???? got ${lvpo.hashCode()} isfault: ${lvpo.isFault()}"
println "???? -> $lvpo"
===
and, just to repeat for reference,
===
DBPriceOffer npo=new DBPriceOffer()
this.editingContext.insertObject(npo)
println "???? setting new valid PO of ${this.permanentGlobalID()}: $npo -> ${npo.permanentGlobalID()} IN.this ${this.editingContext.hashCode()} IN.po ${npo.editingContext.hashCode()}"
===
along with
===
boolean databaseContextFailedToFetchObject(EODatabaseContext ctxt, Object object, EOGlobalID gid) {
println "SPC: failed-to-fetch $gid ($object / ${object.getClass()}), missing ${ctxt.missingObjectGlobalIDs()}"
false
}
===
for new price order I get this result:
===
???? setting new valid PO of _EOIntegralKeyGlobalID[DBAuction (java.lang.Integer)1000015]: <DBPriceOffer@351793642 PK:null N /EC:1655327563> -> _EOIntegralKeyGlobalID[DBPriceOffer (java.lang.Integer)1000275] IN.this 1655327563 IN.po 1655327563
...
???? about to get _EOIntegralKeyGlobalID[DBPriceOffer (java.lang.Integer)1000275] of <DBAuction@422562876 PK:1000015 E:2 Title:'blah' /EC:1655327563> /EC:1655327563
???? got 1165696376 isfault: true
08:18:48.470 DEBUG === Begin Internal Transaction
08:18:48.470 DEBUG evaluateExpression: <com.webobjects.jdbcadaptor.FrontbasePlugIn$FrontbaseExpression: "SELECT t0."C_AMOUNT", t0."C_AUCTION_ID", t0."C_COMM_PARTNER_ID", t0."C_CREATION_DATE", t0."C_CREATOR_ID", t0."C_PRICE", t0."C_PT_ID", t0."C_SHEET_CONFIRMED",
t0."C_UID", t0."C_VALID_OFFER" FROM "T_PRICE_OFFER" t0 WHERE t0."C_UID" = 1000275" withBindings: >
08:18:48.471 DEBUG 0 row(s) processed
08:18:48.473 DEBUG === Commit Internal Transaction
SPC: failed-to-fetch _EOIntegralKeyGlobalID[DBPriceOffer (java.lang.Integer)1000275] (<DBPriceOffer@1165696376 PK:1000275 /EC:1655327563> / class model.DBPriceOffer), missing []
???? -> <DBPriceOffer@1165696376 PK:1000275 /EC:1655327563>
===
???? setting new valid PO of [DBAuction.1000015]: <DBPriceOffer@34841915 PK:null N /EC:73728309> -> [DBPriceOffer.1000206] IN.this 73728309 IN.po 73728309
Why does it say PK:null? If a permanent GID has been assigned, should be PK not have a value? And it is null, then null is getting cached here _lastValidPOCacheGID[this.permanentGlobalID()]=npo.permanentGlobalID() Which I think explains why it is
neither found in the EC or fetched?
Well search me. Perhaps this is the gist of the problem? I thought it is normal for the PK to be null until saved to DB; anyway, if I fall back from faultForGlobalID to my hack[*], then this code: