Re: Cayenne Operations Sorters

From: Andriy Shapochka (ashapochk..otmail.com)
Date: Tue Jan 28 2003 - 14:42:52 EST

  • Next message: Andrus Adamchik: "Relationships that are really lazy"

    > > 1) We add configurable sequences to Cayenne - this will be needed by
    > > Step 2.
    >
    > Could you explain a bit on how this will be done? I remember you added
    > some handling for this in the DataMap and introduced some changes in the
    > XML format?
    >

    I am attaching the modified data-map.dtd with plenty of comments on using
    this new feature.
    And here are the principles at a glance:

    1) The feature is optional. When a db key generator is not defined for a
    DbEntity the unchanged Cayenne classic code is used.
    2) A database key generator is a logical notion intended to define automatic
    generation of primary key values for a DbEntity
        with declared single integer primary key.
    3) A key generator is described by its name, type, and cache size (ref to
    data-map.dtd for details and examples)
        Currently two types are defined: ORACLE, NAMED_SEQUENCE_TABLE
        As of now ORACLE type is supported only.
    4) ORACLE - The existing Oracle sequence with the corresponding name is used
    for primary key generation. The generation itself is completely based on
    your code, so you know how it works.
    NAMED_SEQUENCE_TABLE (not supported yet, but the concept is very clear) -
    Standard portable analog of an Oracle sequence. The existing table with the
    name, one column, and one row is used for primary key generation. Let me
    mark here - the other widespread approach when there is one table with rows
    storing sequence name and value for several primary keys is, in fact,
    wicked. The reason is a potential peril of table level lockings by RDBMS so
    as a result when one modifies one of the rows during the key generation
    process access to the other rows is temporarily locked by the database
    engine and parallel key value generation for several primary keys becomes
    impossible which is a disaster for intensively loaded multi-transactional
    environments.
    5) While the modeler does not support key generator configuration (no time
    for this, sorry) the MapLoader does therefore, defined in the map xml file
    manually, configuration will not be lost by the modeler.
    6) New generators are as hidden from a user as the Cayenne classic ones.





    This archive was generated by hypermail 2.0.0 : Tue Jan 28 2003 - 14:41:55 EST