Foreign keys and database operation ordering
Foreign keys and database operation ordering
- Subject: Foreign keys and database operation ordering
- From: Cedarstone <email@hidden>
- Date: Wed, 11 Feb 2009 17:44:47 +0000
Hi
I am using MySQL with WO on a new application so have control over how
things are implemented. I am unsure what is the best way to work with
foreign key constraints for actions such as database inserts and
deletes to make sure that database actions are done in the correct
order to avoid foreign key constraint errors.
I know this is a fairly common EOF problem but am interested in WO
gurus' views. From what I can tell there are three ways to get round
this ordering problem, unfortunately the first is not an option for me
using MySQL:
1) Use "DEFERRABLE INITIALLY DEFERRED" option for your foreign keys.
Not an option for MySQL as it is not supported.
2) Do not use foreign key constraints in the MySQL tables and instead
rely on the EOModel to implement the equivalent constraints.
3) Implement a EODatabaseContext.Delegate object with the
databaseContextWillPerformAdaptorOperations method to manually control
the ordering of operations.
Given that option 1 is not available for me what is the preferred way
to handle this ordering issue from 2 and 3?
Any advise welcome!
Regards
Giles
_______________________________________________
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