This is a complete shot in the dark, but how does Sybase handle
constraints within one transaction? Would the OrderHeader insert have
to be committed before you can issue an INSERT into a related table?
If that's not it, what is the actual order_detlcost_ordhdr constraint?
Is it a compound FK?
Also, I don't know your business case, but It seems odd that the
OrderDetailCost entity would be related directly to the OrderHeader
entity and not to the OrderDetail entity.
Dave
On May 15, 2009, at 1:47 PM, Lon Varscsak wrote:
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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com
This email sent to [email protected]
_______________________________________________
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]