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:
[EMAIL PROTECTED] is currently saving
for [EMAIL PROTECTED] so it cannot
prepare to save for [EMAIL PROTECTED]
[EMAIL PROTECTED] has sources
([EMAIL PROTECTED],
[EMAIL PROTECTED])
Reason:
prepareForSaveWithCoordinator:
[EMAIL PROTECTED] is currently saving
for [EMAIL PROTECTED] so it cannot
prepare to save for [EMAIL PROTECTED]
[EMAIL PROTECTED] has sources
([EMAIL PROTECTED],
[EMAIL PROTECTED])
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 (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to archive@mail-archive.com