Error on saveChanges with WOBrowser or WOCheckBoxList
Error on saveChanges with WOBrowser or WOCheckBoxList
- Subject: Error on saveChanges with WOBrowser or WOCheckBoxList
- From: "Sennikov, Dimitri" <email@hidden>
- Date: Mon, 11 Feb 2008 15:18:16 -0500
- Thread-topic: Error on saveChanges with WOBrowser or WOCheckBoxList
Hi,
I have a 1-to-many relationship (User ->> Departments). With either
WOBrowser or WOCheckBoxList, whenever a department is selected, an error
is produced when trying to save User where WebObjects is trying to
overwrite the selected department's ID (primary key), "UPDATE
WA_Departments SET id = NULL WHERE (id = ? AND description = ? AND
managerID is NULL AND name = ?)" withBindings: 1:2(id),
2:"Engineering"(description), 3:"Engineering"(name).
Has anybody got same error and is there a known workaround other than
creating custom WORepetition? I'm developing on Eclipse/WOLips on
Windows and would like to get this to work because I have many more
components to come that will require same kind of functionality, and
frankly WOBrowser is much easier than WORepetition with manual item
processing.
Here's my WOBrowser object:
DepartmentList : WOBrowser {
list = departmentDisplayGroup.displayedObjects;
item = department;
displayString = department.name;
selections = user.departments;
multiple = true;
size = 6;
}
Here's the error stack trace:
Application: WebApp
Error: com.webobjects.eoaccess.EOGeneralAdaptorException:
EvaluateExpression failed: : Next exception:SQL State:23000 -- error
code: 1048 -- msg: Column 'id' cannot be null
Reason: EvaluateExpression failed:
<com.webobjects.jdbcadaptor.MySQLPlugIn$MySQLExpression: "UPDATE
WA_Departments SET id = NULL WHERE (id = ? AND description = ? AND
managerID is NULL AND name = ?)" withBindings: 1:2(id),
2:"Engineering"(description), 3:"Engineering"(name)>: Next exception:SQL
State:23000 -- error code: 1048 -- msg: Column 'id' cannot be null
Stack trace: File Line# Method Package
------------------------------------------------------------------------
--------
EODatabaseContext.java 4500
_exceptionWithDatabaseContextInformationAdded com.webobjects.eoaccess
EODatabaseContext.java 6212 performChanges com.webobjects.eoaccess
EOObjectStoreCoordinator.java 371 saveChangesInEditingContext
com.webobjects.eocontrol
EOEditingContext.java 3176 saveChanges com.webobjects.eocontrol
EditUser.java 95 SaveUser dyn.webapp.components
NativeMethodAccessorImpl.java NA invoke0 sun.reflect
NativeMethodAccessorImpl.java NA invoke sun.reflect
DelegatingMethodAccessorImpl.java NA invoke sun.reflect
Method.java NA invoke java.lang.reflect
NSKeyValueCoding.java 636 methodValue com.webobjects.foundation
NSKeyValueCoding.java 1134 valueInObject com.webobjects.foundation
NSKeyValueCoding.java 1293 valueForKey com.webobjects.foundation
WOComponent.java 1686 valueForKey com.webobjects.appserver
NSKeyValueCoding.java 447 valueForKey com.webobjects.foundation
NSKeyValueCodingAdditions.java 212 valueForKeyPath
com.webobjects.foundation
WOComponent.java 1754 valueForKeyPath com.webobjects.appserver
EditUser.java 87 valueForKeyPath dyn.webapp.components
WOKeyValueAssociation.java 50 valueInComponent
com.webobjects.appserver._private
WOSubmitButton.java 70 invokeAction com.webobjects.appserver._private
WODynamicGroup.java 105 invokeChildrenAction
com.webobjects.appserver._private
WODynamicGroup.java 115 invokeAction com.webobjects.appserver._private
WOForm.java 134 invokeAction com.webobjects.appserver._private
WODynamicGroup.java 105 invokeChildrenAction
com.webobjects.appserver._private
WODynamicGroup.java 115 invokeAction com.webobjects.appserver._private
WOComponent.java 1078 invokeAction com.webobjects.appserver
WOSession.java 1353 invokeAction com.webobjects.appserver
WOApplication.java 1736 invokeAction com.webobjects.appserver
WOComponentRequestHandler.java 206 _dispatchWithPreparedPage
com.webobjects.appserver._private
WOComponentRequestHandler.java 298 _dispatchWithPreparedSession
com.webobjects.appserver._private
WOComponentRequestHandler.java 332 _dispatchWithPreparedApplication
com.webobjects.appserver._private
WOComponentRequestHandler.java 369 _handleRequest
com.webobjects.appserver._private
WOComponentRequestHandler.java 442 handleRequest
com.webobjects.appserver._private
WOApplication.java 1678 dispatchRequest com.webobjects.appserver
WOWorkerThread.java 144 runOnce com.webobjects.appserver._private
WOWorkerThread.java 226 run com.webobjects.appserver._private
Thread.java NA run java.lang
_______________________________________________
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