Re: ec.saveChanges() throws exception, still saves
Re: ec.saveChanges() throws exception, still saves
- Subject: Re: ec.saveChanges() throws exception, still saves
- From: Chuck Hill <email@hidden>
- Date: Tue, 05 Feb 2013 20:04:57 -0800
On 2013-02-05, at 1:52 PM, Ramsey Gurley wrote:
>
> On Feb 5, 2013, at 2:14 PM, Chuck Hill wrote:
>
>>
>> On 2013-02-05, at 12:55 PM, Ramsey Gurley wrote:
>>
>>> **** Caught: java.lang.IllegalStateException: incrementSnapshotCountForGlobalID: com.webobjects.eoaccess.EODatabase com.webobjects.eoaccess.EODatabase@74bfd10a -- is unable to increment snapshot count for object with global ID <EOTemporaryGlobalID: 0 0 -64 -88 100 98 0 0 7 -36 1 0 0 0 1 60 -85 -83 -87 -21 79 -127 -20 23> - no snapshot exists
>>> Extra Information:
>>> Actor = No Actor
>>> java.lang.IllegalStateException: incrementSnapshotCountForGlobalID: com.webobjects.eoaccess.EODatabase com.webobjects.eoaccess.EODatabase@74bfd10a -- is unable to increment snapshot count for object with global ID <EOTemporaryGlobalID: 0 0 -64 -88 100 98 0 0 7 -36 1 0 0 0 1 60 -85 -83 -87 -21 79 -127 -20 23> - no snapshot exists
>>> at com.webobjects.eoaccess.EODatabase.incrementSnapshotCountForGlobalID(EODatabase.java:1062)
>>> at com.webobjects.eoaccess.EODatabaseContext.commitChanges(EODatabaseContext.java:6368)
>>> at com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingContext(EOObjectStoreCoordinator.java:386)
>>> at com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192)
>>> at er.extensions.eof.ERXEC._saveChanges(ERXEC.java:1176)
>>> at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:1099)
>>>
>>> Just wondering about this.. I got an exception saving an ec, but the EOs still managed to save into the db. Is that the rule then? EOGeneralAdaptorException == no save, IllegalStateException or others == save?
>>
>> I don't think I would call that a rule. But EOF does not write a rollback transaction if an unexpected error (which this certainly is!) happens late in the save cycle.
>>
>> How did you manage this? It should not still have an EOTemporaryGlobalID at this point.
>
> I blame the class property PK(s) among other things.
I do that and have not had this problem. Or any others.
> *sigh*
>
> Unfortunately, I'm not even sure which eo/entity triggered it from the error message. Even more fun, it was followed by a second exception trying to email an error report on the first. The exception resulted from an attempt to fetch the email address objects from the database.
You can ignore that one. That is an EOF bug caused by the previous bug. It leaves the database context in an inconsistent state.
Chuck
> ** Second exception java.lang.IllegalStateException: Cannot obtain globalId for an object which is registered in an other than the databaseContext's active editingContext, object: <er.corebl.model.ERCMailMessage pk:"null">, databaseContext: com.webobjects.eoaccess.EODatabaseContext@6b96bac4, object's editingContext: er.extensions.eof.ERXEC@7b6d18f2, databaseContext's active editingContext: er.extensions.eof.ERXEC@3af7345b
> at com.webobjects.eoaccess.EODatabaseContext._globalIDForObject(EODatabaseContext.java:4660)
> at com.webobjects.eoaccess.EODatabaseContext.databaseOperationForObject(EODatabaseContext.java:4767)
> at com.webobjects.eoaccess.EODatabaseContext.valuesForKeys(EODatabaseContext.java:6535)
> at com.webobjects.eocontrol.EOObjectStoreCoordinator.valuesForKeys(EOObjectStoreCoordinator.java:326)
> at com.webobjects.eoaccess.EOQualifierSQLGeneration$_KeyValueQualifierSupport.schemaBasedQualifierWithRootEntity(EOQualifierSQLGeneration.java:439)
> at er.extensions.ERXExtensions$KeyValueQualifierSQLGenerationSupport.schemaBasedQualifierWithRootEntity(ERXExtensions.java:359)
> at com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._schemaBasedQualifierWithRootEntity(EOQualifierSQLGeneration.java:179)
> at com.webobjects.eoaccess.EOQualifierSQLGeneration$_AndQualifierSupport.schemaBasedQualifierWithRootEntity(EOQualifierSQLGeneration.java:530)
> at com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._schemaBasedQualifierWithRootEntity(EOQualifierSQLGeneration.java:179)
> at com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecification(EODatabaseChannel.java:227)
> at com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecificationEditingContext(EODatabaseContext.java:3055)
> at com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification(EODatabaseContext.java:3195)
> at com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecification(EOObjectStoreCoordinator.java:488)
> at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4069)
> at er.extensions.eof.ERXEC.objectsWithFetchSpecification(ERXEC.java:1305)
> at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4444)
> at er.extensions.eof.EOEnterpriseObjectClazz.objectsMatchingQualifier(EOEnterpriseObjectClazz.java:358)
> at er.extensions.eof.EOEnterpriseObjectClazz.objectsMatchingQualifier(EOEnterpriseObjectClazz.java:354)
> at er.corebl.model.ERCMailMessage.addToRecipients(ERCMailMessage.java:268)
> at er.corebl.model.ERCMailMessage.addToRecipients(ERCMailMessage.java:286)
> at er.corebl.model.ERCMailMessage$ERCMailMessageClazz.composeMailMessage(ERCMailMessage.java:91)
> at er.corebl.ERCoreBL.reportException(ERCoreBL.java:313)
>
>
>
>
>
>
>
>
--
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden