Re: MySql AUTO_PK_SUPPORT

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Sat Apr 22 2006 - 03:15:37 EDT

  • Next message: Andrus Adamchik: "Re: PK problem with Postgre"

    On Apr 22, 2006, at 11:12 AM, Andrus Adamchik wrote:

    > 4. This line "runUpdate(node, pkDeleteString(dbEntities))" should
    > only use a subset obtained in (3)

    Of course this last point is wrong, but you should get the general
    idea :-)

    Andrus

    On Apr 22, 2006, at 11:12 AM, Andrus Adamchik wrote:
    >
    > On Apr 21, 2006, at 12:33 PM, Borut BolĨina wrote:
    >> 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)
    >
    > An implementation of a smarter auto PK configuration mechanism has
    > been pending for some time, but I think this particular issue can
    > be addresses separately. You can try it on a custom PK generator
    > and I appreciate if you log this issue in Jira. Here is how the
    > solution might look like:
    >
    > 1. Override JdbcPkGenerator.createAutoPk(DataNode node, List
    > dbEntities) as follows -
    > 2. Do a select from AUTO_PK_SUPPORT to check which entities are
    > already present in the DB
    > 3. Subtract those entities from dbEntities list, getting a subset
    > of entities whose records are missing
    > 4. This line "runUpdate(node, pkDeleteString(dbEntities))" should
    > only use a subset obtained in (3)
    >
    >
    > Andrus



    This archive was generated by hypermail 2.0.0 : Sat Apr 22 2006 - 03:16:18 EDT