Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

You may be seeing problems like these in your application:

I've run into a rather nasty little problem after making some changes to my app recently. The problem never showed in testing and is difficult to contrive (which is the nasty bit). After an arbitrary and large number of requests, an arbitrary and small proportion of fetches fail. That is to say that some fetches give an object whose properties are all null. For example I wish to fetch a Member with username 'x'. I use a named EOFetchSpecification, specify the qualifier bindings and fetch my EOs.

Code Block
EOFetchSpecification fetchSpec = EOFetchSpecification.fetchSpecificationNamed("usernameFetchSpec", "Member");
fetchSpec = fetchSpec.fetchSpecificationWithQualifierBindings(new NSDictionary("x", "usernameValue"));
NSArray results = ec.objectsWithFetchSpecification(fetchSpec);

In most cases I receive the expected results, but in some the first Member object in the NSArray has a null username, password, etc.

No Format
java.lang.IllegalStateException: Encountered a newly inserted EO with an owns destination relationship but no snapshot.
java.lang.IllegalStateException: Encountered a newly inserted EO with an owns destination relationship but no snapshot.
	at com.webobjects.eocontrol.EOEditingContext._processOwnedObjects(
	at com.webobjects.eocontrol.EOEditingContext._processDeletedObjects(
	at com.webobjects.eocontrol.EOEditingContext._processRecentChanges(
	at com.webobjects.eocontrol.EOEditingContext.processRecentChanges(
	at com.webobjects.eocontrol.EOEditingContext._processObjectStoreChanges(
No Format
java.lang.IllegalStateException: rowDiffsForAttributes: snapshot in com.webobjects.eoaccess.EODatabaseOperation {
_dbSnapshot = {};
this = "< a849b0 _EOIntegralKeyGlobalID[DownloadLog (java.lang.Long)0]>"; }";
_globalID = _EOIntegralKeyGlobalID[DownloadLog (java.lang.Long)0];
_databaseOperator = "EODatabaseUpdateOperator"; }
does not contain value for attribute named downloadDate with snapshot key: downloadDate

The stack trace is:
	at com.webobjects.eoaccess.EODatabaseOperation.rowDiffsForAttributes(
	at com.webobjects.eoaccess.EODatabaseContext.createAdaptorOperationsForDatabaseOperationAttributes(
	at com.webobjects.eoaccess.EODatabaseContext.createAdaptorOperationsForDatabaseOperation(
	at com.webobjects.eoaccess.EODatabaseContext.performChanges(
	at com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingContext(
	at com.webobjects.eocontrol.EOEditingContext.saveChanges(
	at net.global_village.eofextensions.ForgetfulEC.saveChanges(
	at net.global_village.eofvalidation.EOEditingContext.saveChanges(
	at net.global_village.eofvalidation.NotifyingEditingContext.saveChanges(

The exception is correct, the snapshot _dbSnapshot = {}; does not contain any values, let alone the one it is looking for. I am not completely sure of how this happens. It is not consistent .

If you want to know the cause of these, go look in a mirror! EOF is not broken, you are abusing it and it is fighting back. Here is what to check:

(wikidiscard -> This information seems too specific and provides no context. I cannot think how looking in a mirror would be helpful. If someone finds this page because they are having a problem, what do they learn from this page? I think that they learn nothing. If there is a point to be made, it can be added to the information in the 'EOF Commandments' page or in some other more appropriate place. -rrk 2011/10/02.)