On May 26, 2010, at 10:57 AM, Larry Mills-Gahl wrote:

Hello,

I setup what I think is a pretty simple program to map some external identifier strings to existing data. Two display groups on one page. First display group is the objects (Center) to be edited, the second display group (ExternalCenter) is used to find the right match by searching on the name.

One attribute of the Center is all that is being updated.

com.webobjects.eoaccess.EOGeneralAdaptorException: EvaluateExpression failed: : Next exception:SQL State:23000 -- error code: 1048 -- msg: Column 'parentCenterFK' cannot be null Reason: EvaluateExpression failed: <com.webobjects.jdbcadaptor.MySQLPlugIn$MySQLExpression: "UPDATE center SET cmsnum = ?, parentCenterFK = NULL, active = NULL WHERE (centerKey = ? AND active = ? AND cmsnum is NULL AND code = ? AND name = ? AND parentCenterFK = ?)" withBindings: 1:"310001"(cmsProviderNumber), 2:620(centerkey), 3:1(active), 4:"HUMED"(code), 5:"University Medical Center"(name), 6:620(parentcenterfk)>: Next exception:SQL State:23000 -- error code: 1048 -- msg: Column 'parentCenterFK' cannot be null

I do not understand why the parentCenterFK is being set to NULL in the SQL

That looks odd to me as well. Try overriding setActive() and adding
if (newValue == null) NSLog.out.appendln(new RuntimeException("active set to null here"); That will show where the null value is coming from (assuming that it is not coming from a bug in EOAccess).


(especially since it looks like it would be set in the bindings). Also, "active" should not be null either. The model and the schema both define these fields as not allowing null.

Do updates affecting those fields work OK in other situations? Have you checked the datatype of these two to ensure that it is correct and consistent with the rest of the model? An incorrect external type could possibly cause this.


Could this be that in some instances a record is it's own parent (parentCenterFK = centerKey)? That is the only special case that I see here that may be causing the problem (is EO protecting itself against some recursive nightmare?)


I'd say that is unlikely.


Chuck

--
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/products/practical_webobjects







_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to