You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@empire-db.apache.org by "Matt DeHoust (JIRA)" <em...@incubator.apache.org> on 2011/09/02 18:05:10 UTC

[jira] [Created] (EMPIREDB-114) Codegen adds redundant relations to the database model

Codegen adds redundant relations to the database model
------------------------------------------------------

                 Key: EMPIREDB-114
                 URL: https://issues.apache.org/jira/browse/EMPIREDB-114
             Project: Empire-DB
          Issue Type: Bug
          Components: CodeGenerator
    Affects Versions: empire-db-2.2.0-incubating
            Reporter: Matt DeHoust


Under some circumstances CodeGen produces redundant relations on the DBDatabase, which may lead to problems if you use the empire-db model to create your schema. The script will fail when you try to create the same foreign key relationship twice.

Steps to reproduce:
1. Define a schema with at least two different tables with foreign key relationships.
2. Use the "dbTablePattern" configuration option.
3. The generated DBDatabase will add the same relations more than once.

This is a major problem if you use empire-db to generate schemas with foreign key relationships. If not, you can work around the problem by modifying the Database.vm template to exclude the relations setup..

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] [Created] (EMPIREDB-114) Codegen adds redundant relations to the database model

Posted by Benjamin Venditti <be...@arcor.de>.
Hi Matt,

thanks for filing that bug. I guess that bug is my fault and as i have 
some free time i can handle it. I'll also have a look on EMPIRE-113 as 
that bug is related to the codegen, too.

cherio
   benjamin

Am 02.09.2011 18:05, schrieb Matt DeHoust (JIRA):
> Codegen adds redundant relations to the database model
> ------------------------------------------------------
>
>                   Key: EMPIREDB-114
>                   URL: https://issues.apache.org/jira/browse/EMPIREDB-114
>               Project: Empire-DB
>            Issue Type: Bug
>            Components: CodeGenerator
>      Affects Versions: empire-db-2.2.0-incubating
>              Reporter: Matt DeHoust
>
>
> Under some circumstances CodeGen produces redundant relations on the DBDatabase, which may lead to problems if you use the empire-db model to create your schema. The script will fail when you try to create the same foreign key relationship twice.
>
> Steps to reproduce:
> 1. Define a schema with at least two different tables with foreign key relationships.
> 2. Use the "dbTablePattern" configuration option.
> 3. The generated DBDatabase will add the same relations more than once.
>
> This is a major problem if you use empire-db to generate schemas with foreign key relationships. If not, you can work around the problem by modifying the Database.vm template to exclude the relations setup..
>
> --
> This message is automatically generated by JIRA.
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>


Re: [jira] [Created] (EMPIREDB-114) Codegen adds redundant relations to the database model

Posted by Benjamin Venditti <be...@arcor.de>.
Hi Matt,

thanks for filing that bug. I guess that bug is my fault and as i have 
some free time i can handle it. I'll also have a look on EMPIRE-113 as 
that bug is related to the codegen, too.

cherio
   benjamin

Am 02.09.2011 18:05, schrieb Matt DeHoust (JIRA):
> Codegen adds redundant relations to the database model
> ------------------------------------------------------
>
>                   Key: EMPIREDB-114
>                   URL: https://issues.apache.org/jira/browse/EMPIREDB-114
>               Project: Empire-DB
>            Issue Type: Bug
>            Components: CodeGenerator
>      Affects Versions: empire-db-2.2.0-incubating
>              Reporter: Matt DeHoust
>
>
> Under some circumstances CodeGen produces redundant relations on the DBDatabase, which may lead to problems if you use the empire-db model to create your schema. The script will fail when you try to create the same foreign key relationship twice.
>
> Steps to reproduce:
> 1. Define a schema with at least two different tables with foreign key relationships.
> 2. Use the "dbTablePattern" configuration option.
> 3. The generated DBDatabase will add the same relations more than once.
>
> This is a major problem if you use empire-db to generate schemas with foreign key relationships. If not, you can work around the problem by modifying the Database.vm template to exclude the relations setup..
>
> --
> This message is automatically generated by JIRA.
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>


[jira] [Updated] (EMPIREDB-114) Codegen adds redundant relations to the database model

Posted by "Matt DeHoust (JIRA)" <em...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/EMPIREDB-114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt DeHoust updated EMPIREDB-114:
----------------------------------

    Attachment: codegen-relations-problem-scenario.patch.txt

This patch provides a test case that shows the problem. No solution is proposed. The test can be improved, but is enough to illustrate the issue.

> Codegen adds redundant relations to the database model
> ------------------------------------------------------
>
>                 Key: EMPIREDB-114
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-114
>             Project: Empire-DB
>          Issue Type: Bug
>          Components: CodeGenerator
>    Affects Versions: empire-db-2.2.0-incubating
>            Reporter: Matt DeHoust
>         Attachments: codegen-relations-problem-scenario.patch.txt
>
>
> Under some circumstances CodeGen produces redundant relations on the DBDatabase, which may lead to problems if you use the empire-db model to create your schema. The script will fail when you try to create the same foreign key relationship twice.
> Steps to reproduce:
> 1. Define a schema with at least two different tables with foreign key relationships.
> 2. Use the "dbTablePattern" configuration option.
> 3. The generated DBDatabase will add the same relations more than once.
> This is a major problem if you use empire-db to generate schemas with foreign key relationships. If not, you can work around the problem by modifying the Database.vm template to exclude the relations setup..

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (EMPIREDB-114) Codegen adds redundant relations to the database model

Posted by "Benjamin Venditti (JIRA)" <em...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/EMPIREDB-114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Venditti resolved EMPIREDB-114.
----------------------------------------

    Resolution: Fixed

- integrated and tested the patch for the testcase supplied by "Matt DeHoust"
- added fix for EMPIREDB-114 solution as follows:
the subroutine "gatherRelations" was called for each tablePattern, although it should have been called just once!

> Codegen adds redundant relations to the database model
> ------------------------------------------------------
>
>                 Key: EMPIREDB-114
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-114
>             Project: Empire-DB
>          Issue Type: Bug
>          Components: CodeGenerator
>    Affects Versions: empire-db-2.2.0-incubating
>            Reporter: Matt DeHoust
>            Assignee: Benjamin Venditti
>         Attachments: codegen-relations-problem-scenario.patch.txt
>
>
> Under some circumstances CodeGen produces redundant relations on the DBDatabase, which may lead to problems if you use the empire-db model to create your schema. The script will fail when you try to create the same foreign key relationship twice.
> Steps to reproduce:
> 1. Define a schema with at least two different tables with foreign key relationships.
> 2. Use the "dbTablePattern" configuration option.
> 3. The generated DBDatabase will add the same relations more than once.
> This is a major problem if you use empire-db to generate schemas with foreign key relationships. If not, you can work around the problem by modifying the Database.vm template to exclude the relations setup..

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (EMPIREDB-114) Codegen adds redundant relations to the database model

Posted by "Francis De Brabandere (JIRA)" <em...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/EMPIREDB-114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francis De Brabandere reassigned EMPIREDB-114:
----------------------------------------------

    Assignee: Benjamin Venditti

Since you are going to take care of this

> Codegen adds redundant relations to the database model
> ------------------------------------------------------
>
>                 Key: EMPIREDB-114
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-114
>             Project: Empire-DB
>          Issue Type: Bug
>          Components: CodeGenerator
>    Affects Versions: empire-db-2.2.0-incubating
>            Reporter: Matt DeHoust
>            Assignee: Benjamin Venditti
>         Attachments: codegen-relations-problem-scenario.patch.txt
>
>
> Under some circumstances CodeGen produces redundant relations on the DBDatabase, which may lead to problems if you use the empire-db model to create your schema. The script will fail when you try to create the same foreign key relationship twice.
> Steps to reproduce:
> 1. Define a schema with at least two different tables with foreign key relationships.
> 2. Use the "dbTablePattern" configuration option.
> 3. The generated DBDatabase will add the same relations more than once.
> This is a major problem if you use empire-db to generate schemas with foreign key relationships. If not, you can work around the problem by modifying the Database.vm template to exclude the relations setup..

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira