On 05/12/2009, at 12:02 AM, Ramsey Lee Gurley wrote:

> Hi Kieran,
> 
> Have you tried vertical inheritance with MySQL?

He wouldn't have. I have and continue to.

> I have Animal->Cat->Leopard. I try to create a leopard and it fails because 
> 
> com.webobjects.eoaccess.EOGeneralAdaptorException: EvaluateExpression failed: 
> <com.webobjects.jdbcadaptor._MySQLPlugIn$MySQLExpression: "INSERT INTO 
> Leopard(spots, id) VALUES (?, ?)" withBindings: 1:33(spots), 2:9(id)>:
>    Next exception:SQL State:23000 -- error code: 1452 -- msg: Cannot add or 
> update a child row: a foreign key constraint fails (`example/leopard`, 
> CONSTRAINT `Leopard_id_id_FK` FOREIGN KEY (`id`) REFERENCES `cat` (`id`))

Yep. I've avoided using fk constraints since mysql doesn't play nice with this.

> It gets the adaptor operations for Animal, then Leopard, then Cat... and 
> blows up at leopard because there's no cat yet (I think).  I had to google 
> for "What are deferred constraints" so I could be very wrong, but I think 
> it's blowing up because of lack of deferred constraints (^_^) It looks like 
> I'll need to have an EODatabaseContext delegate override 
> databaseContextWillOrderAdaptorOperations to fix it, unless there is 
> something in the ERXSQLHelper that can get there first.
> 
> This just happens to be a timely thread since I was messing with my 
> MySQLPlugin last night (^_^)

What does your plugin do? 

with regards,
--

Lachlan Deck



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

This email sent to arch...@mail-archive.com

Reply via email to