Constraint error when I don't think I should have one.
Constraint error when I don't think I should have one.
- Subject: Constraint error when I don't think I should have one.
- From: Lon Varscsak <email@hidden>
- Date: Fri, 15 May 2009 10:47:43 -0700
I have an object graph that's being saved and it seems okay. I have an OrderHeader object and an OrderDetailCost object where the foreign key for OrderDetailCost requires OrderHeader to exist.
Here's the sql (snipped):
May 15 10:05:00 DataBuilder[2500] DEBUG NSLog - === Begin Internal Transaction
May 15 10:05:00 DataBuilder[2500] DEBUG NSLog - evaluateExpression: <com.webobjects.jdbcadaptor.SybasePlugIn$SybaseExpression: "INSERT INTO production..order_header(personalization_amount, ...snip....
May 15 10:05:00 DataBuilder[2500] DEBUG NSLog - evaluateExpression: <com.webobjects.jdbcadaptor.SybasePlugIn$SybaseExpression: "INSERT INTO production..order_detail_costs(duty_tax_cost, ...snip....
The primary key values in both tables are correct (the sql that I snipped shows that)...but I get a constraint error saying that order_detail_costs expects to have order_header inserted first. I'm stumped, because that's exactly what it's doing.
May 15 10:05:00 DataBuilder[2500] INFO er.transaction.adaptor.Exceptions - Database Exception occured: com.webobjects.eoaccess.EOGeneralAdaptorException: EvaluateExpression failed: <com.webobjects.jdbcadaptor.SybasePlugIn$SybaseExpression: "INSERT INTO production..order_detail_costs(duty_tax_cost ...snip...:
Next exception:SQL State:23000 -- error code: 546 -- msg: Foreign key constraint violation occurred, dbname = 'production', table name = 'production..order_detail_costs', constraint name = 'order_detlcost_ordhdr'.
Any ideas?
Thanks,
Lon
Using:
Sybase 12.5.4 (with the latest jConnect...their jdbc driver)
WebObjects 5.4.3 with Wonder from a couple of weeks ago
_______________________________________________
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