From: David A. <web...@av...> - 2008-10-16 22:26:53
|
On Oct 16, 2008, at 5:38 PM, Chuck Hill wrote: > > On Oct 16, 2008, at 2:26 PM, David Avendasora wrote: > >> Okay. I'm trying to do a very simple delete by clicking a "delete" >> button. > > > Maybe you should go back to a nice, save JavaClient app with > Vertical Inheritance Hey now! I got rid of VI a long time ago! You wound me. > and MS Access. :-) Now you are just being mean. MS SQL Server is not MS Access. It has pretensions of being enterprise-class. >> There is one button for each item in a WORepetition. >> aManufacturingSchedule is the value bound to the WORepetition's >> item binding.: >> >> public WOComponent deleteManufacturingSchedule() { >> if (log.isDebugEnabled()) { >> log.debug("Delete Schedule: " + >> aManufacturingSchedule().scheduleDescription()); >> } > > Maybe try > scheduleListingEC.revert(); > here just for giggles. I assume this is just to make sure I am only doing the delete with the save. And it seems to have worked to clear up the NullPropertyExceptions - more on this later. But now I'm getting a MandatoryToManyRelationshipException validation error, and it's on a relationship that is on an object that is itself the destination of a required ToMany relationship of ManufacturingSchedule. Both of these Relationships have cascade delete rules. ManufacturingSchedule <->> ScheduledManufacturingOrderItem <->> ScheduledManufacturingOrderItemRouting So simply deleting a ManufacturingSchedule should delete every object in the related object-graph, which could be literally hundreds of objects. But that's the whole point of having the Cascade Deletion rule. Right? It's complaining about a ScheduledManufacturingOrderItem not having any ScheduledManufacturingOrderItemRoutings. Ahg! See stack trace below. >> scheduleListingEC.deleteObject(aManufacturingSchedule()); >> scheduleListingEC.saveChanges(); >> return context().page(); >> } > Well, something completely wrong is happening. It is inserting, not > deleting! > > > at > com > .webobjects > .eocontrol.EOCustomObject.validateForInsert(EOCustomObject.java:1473) > at > com > .webobjects > .eocontrol.EOEditingContext.validateTable(EOEditingContext.java:2249) > at > com > .webobjects > .eocontrol > .EOEditingContext.validateChangesForSave(EOEditingContext.java:3029) > at > com > .webobjects > .eocontrol > .EOEditingContext._prepareForPushChanges(EOEditingContext.java:3283) > at > com > .webobjects > .eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3213) > at er.extensions.eof.ERXEC._saveChanges(ERXEC.java:981) > at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:903) Hmmm.... There is a form on this page that allows you to create a ManufacturingSchedule, but it is in it's own WOForm. I have three forms on the page. One to search, one to create new ManufacturingSchedules and one to Delete/Edit ManufacturingSchedules. The Delete/Edit form surrounds a WORepitition of all the ManufacturingSchedules that are the results of the search form. Submitting one form on a page shouldn't submit them all, should it? Be nice now, I'm at least trying out this whole "Web" application thing... It's only taken you what? 4 years of badgering me about Java Client. Don't scare me away now! :-P Dave Oct 16 18:06:13 BakeryManagementWebClient[50999] (ScheduleListing.java: 91) DEBUG com.bestmaid.bakeryManagement.client.web.components.scheduling.ScheduleListing - Delete Schedule: 10/14/08 Baked B Oct 16 18:06:14 BakeryManagementWebClient[50999] (ERXNSLogLog4jBridge.java:43) WARN NSLog - <com.webobjects.appserver._private.WOComponentRequestHandler>: Exception occurred while handling request: <er.extensions.validation.ERXValidationException object: 62.000000 03100102140451 Baked Homestyle 72/1oz Ginger w/Sugar due on 2008-10-15 04:00:00 Etc/GMT on 10/14/08 Baked B; propertyKey: scheduledManufacturingOrderItemRoutings; type: MandatoryToManyRelationshipException; additionalExceptions: ()> [2008-10-16 18:06:14 EDT] <WorkerThread8> <er.extensions.validation.ERXValidationException object: 62.000000 03100102140451 Baked Homestyle 72/1oz Ginger w/Sugar due on 2008-10-15 04:00:00 Etc/GMT on 10/14/08 Baked B; propertyKey: scheduledManufacturingOrderItemRoutings; type: MandatoryToManyRelationshipException; additionalExceptions: ()> at com .webobjects.eoaccess.EORelationship.validateValue(EORelationship.java: 1807) at com .webobjects .eoaccess .EOEntityClassDescription .validateValueForKey(EOEntityClassDescription.java:443) at er .extensions .eof .ERXEntityClassDescription .validateValueForKey(ERXEntityClassDescription.java:808) at com .webobjects .eocontrol.EOCustomObject.validateValueForKey(EOCustomObject.java:1339) at com .webobjects .eocontrol.EOCustomObject.validateForSave(EOCustomObject.java:1411) at com .webobjects .eocontrol.EOCustomObject.validateForUpdate(EOCustomObject.java:1490) at com .webobjects .eocontrol.EOEditingContext.validateTable(EOEditingContext.java:2252) at com .webobjects .eocontrol .EOEditingContext.validateChangesForSave(EOEditingContext.java:3042) at com .webobjects .eocontrol .EOEditingContext._prepareForPushChanges(EOEditingContext.java:3283) at com .webobjects .eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3213) at er.extensions.eof.ERXEC._saveChanges(ERXEC.java:981) at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:903) at com.bestmaid.bakeryManagement.client.web.components.scheduling.ScheduleListing.deleteManufacturingSchedule (ScheduleListing.java:95) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun .reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 39) at sun .reflect .DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java: 25) at java.lang.reflect.Method.invoke(Method.java:585) at com.webobjects.foundation.NSKeyValueCoding$ValueAccessor $1.methodValue(NSKeyValueCoding.java:684) at com.webobjects.foundation.NSKeyValueCoding $_MethodBinding.valueInObject(NSKeyValueCoding.java:1160) at com.webobjects.foundation.NSKeyValueCoding $DefaultImplementation.valueForKey(NSKeyValueCoding.java:1268) at com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java: 1539) at com.webobjects.foundation.NSKeyValueCoding $Utility.valueForKey(NSKeyValueCoding.java:498) at com.webobjects.foundation.NSKeyValueCodingAdditions $DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java: 212) at com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java: 1600) at com .webobjects .appserver ._private .WOKeyValueAssociation.valueInComponent(WOKeyValueAssociation.java:46) at com .webobjects .appserver._private.WOSubmitButton.invokeAction(WOSubmitButton.java:59) at er.extensions.foundation.ERXPatcher$DynamicElementsPatches $SubmitButton.invokeAction(ERXPatcher.java:212) at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101) at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110) at er .extensions .components._private.ERXWORepetition.invokeAction(ERXWORepetition.java: 445) at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101) at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110) at er.ajax.AjaxDynamicElement.invokeAction(AjaxDynamicElement.java:83) at er.ajax.AjaxUpdateContainer.invokeAction(AjaxUpdateContainer.java: 61) at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101) at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110) at er .extensions.components._private.ERXWOForm.invokeAction(ERXWOForm.java: 180) at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101) at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110) at com .webobjects .appserver ._private.WOComponentContent.invokeAction(WOComponentContent.java:31) at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101) at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110) at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java: 945) at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java:93) at com .webobjects .appserver ._private.WOComponentReference.invokeAction(WOComponentReference.java: 104) at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101) at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110) at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java: 945) at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java:93) at com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1168) at com.webobjects.appserver.WOApplication.invokeAction(WOApplication.java: 1375) at er .extensions .appserver .ajax.ERXAjaxApplication.invokeAction(ERXAjaxApplication.java:48) at er .extensions.appserver.ERXApplication.invokeAction(ERXApplication.java: 1529) at com .webobjects .appserver ._private .WOComponentRequestHandler ._dispatchWithPreparedPage(WOComponentRequestHandler.java:196) at com .webobjects .appserver ._private .WOComponentRequestHandler ._dispatchWithPreparedSession(WOComponentRequestHandler.java:287) at com .webobjects .appserver ._private .WOComponentRequestHandler ._dispatchWithPreparedApplication(WOComponentRequestHandler.java:322) at com .webobjects .appserver ._private .WOComponentRequestHandler ._handleRequest(WOComponentRequestHandler.java:358) at com .webobjects .appserver ._private .WOComponentRequestHandler .handleRequest(WOComponentRequestHandler.java:432) at com .webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java: 1306) at er .extensions .appserver .ERXApplication.dispatchRequestImmediately(ERXApplication.java:1646) at er .extensions .appserver.ERXApplication.dispatchRequest(ERXApplication.java:1610) at com .webobjects .appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:173) at com .webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java: 254) at java.lang.Thread.run(Thread.java:613) |