[JIRA] Created: (CAY-527) MySql AUTO_PK_SUPPORT

From: JIRA (Borut)
Date: Sat Apr 22 2006 - 10:52:42 EDT

  • Next message: Wonder World (JIRA): "[JIRA] Created: (CAY-528) NullPointer Execption by deleting a Class"

    MySql AUTO_PK_SUPPORT
    ---------------------

             Key: CAY-527
             URL: http://issues.apache.org/cayenne/browse/CAY-527
         Project: Cayenne
            Type: Bug

      Components: Cayenne Core Library
        Versions: 1.2 [BETA]
     Environment: WinXP, Java 5
        Reporter: Borut BolĨina

    Hi,

    I am constructing database tables with dbGenerator like this

       DbGenerator generator = new DbGenerator(autoDbAdapter, dataMap);

       generator.setShouldCreatePKSupport(true);
       generator.setShouldCreateFKConstraints(true);
       generator.setShouldDropTables(false);

       generator.runGenerator(dataSource);

    This code executes every time an application is restarted. Becouse setShouldDropTables is set to false, the tables in that database are created only the first time - as it should be. But, becouse setShouldCreatePKSupport is set to true, this gets executec every time

    INFO QueryLogger: DELETE FROM AUTO_PK_SUPPORT WHERE TABLE_NAME IN ('source')
    INFO QueryLogger: INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('source', 200)

    Of course I don't want AUTO_PK_SUPPORT to delete and reset values already there from previous application runs. Is there a way, when this

       INFO QueryLogger: *** error.
       java.sql.SQLException: Table 'AUTO_PK_SUPPORT' already exists

    happens, that the above DELETE and INSERT don't happen?

    -- 
    This message is automatically generated by JIRA.
    -
    If you think it was sent incorrectly contact one of the administrators:
       http://issues.apache.org/cayenne/secure/Administrators.jspa
    -
    For more information on JIRA, see:
       http://www.atlassian.com/software/jira
    



    This archive was generated by hypermail 2.0.0 : Sat Apr 22 2006 - 10:53:49 EDT