Re: how to modify primary key cache size in mysql?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Jul 14 2004 - 00:35:32 EDT

  • Next message: Ittay Dror: "checking out cayenne"

    Hi Dan,

    There is no external setting for that (yet), still you can change the
    size of PK cache in the code somewhere on app startup. E.g.:

    DataDomain domain = Configuration.getSharedConfiguration().getDomain();
    DataNode node = (DataNode) domain.getDataNodes().get(0);
    JdbcPkGenerator pkGen = (JdbcPkGenerator)
    node.getAdapter().getPkGenerator();
    pkGen.setPkCacheSize(1);

    Hope this helps.

    Andrus

    On Jul 13, 2004, at 10:21 PM, Dan Kim wrote:

    > hello,
    >
    > i know this question has been asked a few times before, but the posts
    > seemed a little dated and i wasn't sure which versions people were
    > using.
    >
    > i am using cayenne 1.0.6 with mysql. i am looking to reduce the size
    > of
    > the primary key cache size from it's default size of 20 to something
    > smaller. i understand this is set to 20 for performance reasons, but i
    > have noticed random behavior where if the cache is not used, then there
    > are large gaps in the ids in the table. thus, i could have consecutive
    > entries jumping 20 ids each time, which could eat up id values quickly.
    >
    > my question is, is there a configuration setting in a file somewhere
    > that
    > i can change to adjust this, or do i need to do this programatically?
    > any
    > answers (and examples if possible) would be greatly appreciated.
    >
    > again, i am working with mysql with cayenne 1.0.6. thanks very much,
    > esp.
    > to all the cayenne developers.
    >
    > dan
    >
    >
    >
    > __________________________________
    > Do you Yahoo!?
    > New and Improved Yahoo! Mail - Send 10MB messages!
    > http://promotions.yahoo.com/new_mail
    >



    This archive was generated by hypermail 2.0.0 : Wed Jul 14 2004 - 00:35:37 EDT