You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by "Andrus Adamchik (JIRA)" <de...@cayenne.apache.org> on 2007/12/25 23:48:44 UTC

[JIRA] Commented: (CAY-116) Improve DbAdapter to support cascading drop constraints when DB does not

    [ https://issues.apache.org/cayenne/browse/CAY-116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12649 ] 

Andrus Adamchik commented on CAY-116:
-------------------------------------

Changed DbAdapter API to allow multiple statements for a single "drop".. Implemented a multi-statement drop for MySQL. Need to do it for other DBs and clean up AccessStackAdapter hack.

> Improve DbAdapter to support cascading drop constraints when DB does not
> ------------------------------------------------------------------------
>
>                 Key: CAY-116
>                 URL: https://issues.apache.org/cayenne/browse/CAY-116
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Cayenne Core Library
>    Affects Versions: 1.0 [LEGACY], 1.1 [LEGACY]
>         Environment: Sybase 11, Linux
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>            Priority: Minor
>             Fix For: UNDEFINED FUTURE
>
>
> When running unit tests with the new test schema ("people"), Sybase chokes on 2nd and subsequent runs since there a circular relationship PERSON -> DEPARTMENT -> PERSON. Sybase has no "CASCADE CONSTRAINTS" clause in the DROP command. 
> This is fixed inside SybaseStackAdapter by manually dropping constraints like this:
> SELECT t0.name FROM sysobjects t0, sysconstraints t1, sysobjects t2
> WHERE t0.id = t1.constrid and t1.tableid = t2.id and t2.name = 'DEPARTMENT'
> and then
> alter table DEPARTMENT drop constraint XYZ
> TODO: DbAdapter only allows a single statement for dropTable. We need to redefine DbAdapter API to allow more then one statement... 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.