[OS-JIRA] Created: (CAY-116) Sybase Schema Generation: no way to drop constraints

From: jir..bjectstyle.org
Date: Sat Apr 10 2004 - 21:39:46 EDT

  • Next message: Mike Kienenberger: "Re: Optimistic Locking, Unit Tests, etc."

    Message:

      A new issue has been created in JIRA.

    ---------------------------------------------------------------------
    View the issue:

      http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-116

    Here is an overview of the issue:
    ---------------------------------------------------------------------
            Key: CAY-116
        Summary: Sybase Schema Generation: no way to drop constraints
           Type: Bug

         Status: Assigned
       Priority: Minor

        Project: Cayenne
     Components:
                 Cayenne Core Library
       Fix Fors:
                 1.1 [DEV]
       Versions:
                 1.0 [STABLE]
                 1.1 [DEV]

       Assignee: Andrus Adamchik
       Reporter: Andrus Adamchik

        Created: Sat, 10 Apr 2004 9:38 PM
        Updated: Sat, 10 Apr 2004 9:38 PM
    Environment: Sybase 11, Linux

    Description:
    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...

    ---------------------------------------------------------------------
    JIRA INFORMATION:
    This message is automatically generated by JIRA.

    If you think it was sent incorrectly contact one of the administrators:
       http://objectstyle.org/jira/secure/Administrators.jspa

    If you want more information on JIRA, or have a bug to report see:
       http://www.atlassian.com/software/jira



    This archive was generated by hypermail 2.0.0 : Sat Apr 10 2004 - 21:39:47 EDT