EOEditing Context Error
EOEditing Context Error
- Subject: EOEditing Context Error
- From: Robyn Hughes <email@hidden>
- Date: Wed, 7 Jun 2006 10:00:51 +1000
I am trying to save changes to the the editing context using this
code and get the error below. Can anyone help?
try
{
//fetch the three primary keys needs for creating the
subTopicResults instance
TrackingObject trackingObject = (TrackingObject)
com.webobjects.eoaccess.EOUtilities.objectMatchingKeyAndValue
(ec,"TrackingObject","trackingObjectName","Performance Planner");
TopicName topicName = (TopicName)
com.webobjects.eoaccess.EOUtilities.objectMatchingKeyAndValue
(ec,"TopicName","topicName","Performance Planner");
SubTopicName subTopicName = (SubTopicName)
com.webobjects.eoaccess.EOUtilities.objectMatchingKeyAndValue
(ec,"SubTopicName","subTopicName",subTopicPageName);
if (trackingObject != null && topicName != null && subTopicName !=
null)
{
//create a new instance of subTopicResults
subTopicResults = ( SubTopicResults)
com.webobjects.eoaccess.EOUtilities.createAndInsertInstance
(ec,"SubTopicResults");
//add the relationships
subTopicResults.addObjectToBothSidesOfRelationshipWithKey
(trackingObject,"trackingObject");
subTopicResults.addObjectToBothSidesOfRelationshipWithKey(((Session)
session()).currentUser,"recipient");
subTopicResults.addObjectToBothSidesOfRelationshipWithKey
(topicName,"topicName");
subTopicResults.addObjectToBothSidesOfRelationshipWithKey
(subTopicName,"subTopicName");
}
save();
}
catch (Exception e)
{
throw e;
}
Error:
java.lang.IllegalStateException: prepareForSaveWithCoordinator:
com.webobjects.eoaccess.EODatabaseContext@ad552c is currently saving
for com.webobjects.eocontrol.EOEditingContext@6e119d so it cannot
prepare to save for com.webobjects.eocontrol.EOEditingContext@6e119d.
com.webobjects.eocontrol.EOObjectStoreCoordinator@86684c has sources
(com.webobjects.eoaccess.EODatabaseContext@ad552c,
com.webobjects.eoaccess.EODatabaseContext@b248c8)
Reason:
prepareForSaveWithCoordinator:
com.webobjects.eoaccess.EODatabaseContext@ad552c is currently saving
for com.webobjects.eocontrol.EOEditingContext@6e119d so it cannot
prepare to save for com.webobjects.eocontrol.EOEditingContext@6e119d.
com.webobjects.eocontrol.EOObjectStoreCoordinator@86684c has sources
(com.webobjects.eoaccess.EODatabaseContext@ad552c,
com.webobjects.eoaccess.EODatabaseContext@b248c8)
Stack trace:
File Line# Method Package
EODatabaseContext.java 5790 prepareForSaveWithCoordinator
com.webobjects.eoaccess
EOObjectStoreCoordinator.java 409 saveChangesInEditingContext
com.webobjects.eocontrol
EOEditingContext.java 3226 saveChanges com.webobjects.eocontrol
PerformanceComponent.java 277 save PerformanceComponent
PerformanceComponent.java 168 createNewSubTopicResults
PerformanceComponent
_______________________________________________
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