Re: Cayenne Operations Sorters

From: Andriy Shapochka (ashapochk..otmail.com)
Date: Tue Jan 28 2003 - 08:18:28 EST

  • Next message: Andriy Shapochka: "ASHWOOD - packages renamed"

    Excellent! Yep, the main line is to group everything we can and process the
    rest individually (rule 80% - 20% :-). Plus, the correct processing
    algorithms. Plus, vendor specific performance improvements when they are
    here to help us for almost free. Of course we do not sort batches literally
    (the sorting is a little bit more general operation and needs more info and
    flexibility) but in the most regular cases it is almost like we sort batches
    and so these operations are very closely related.

    > After looking at Andriy's code some more I am (finally) starting to
    realize
    > that we don't need to reinvent much. Everything is very solid.
    >
    > To give everybody a preview of his code, I just created a new top module
    in
    > Cayenne CVS called "sandbox". It is outside of the main Cayenne tree:
    >
    >
    http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/cayenne/sandbox/andrus/src/ja
    va/org/objectstyle/cayenne/batch/
    >
    > In the future other developers are also welcome to check in their
    > experimental code in this module. In particular I checked in "batch"
    > package - the future of DataContext commit processing.
    >
    > I think we can start switching to "batches" right away. Basically batch is
    > a set of "modify" database operations belonging to the same DbEntity and
    > having similar semantics. As a result, all entries in the batch can be
    > mapped to the same JDBC PreparedStatement. Also each batch describes
    > operations for the same entity, so sorting can be done by batches instead
    > of individual queries. This is something Andriy tried to tell me all along
    :-)
    >
    > Andriy, do you feel like taking the lead on that switch?

    Yes, of course I can do that. The following plan seems decent to me:

    1) We add configurable sequences to Cayenne - this will be needed by Step 2.

    2) I integrate the testing app to formally run against Cayenne. At this
    stage the tests will most likely fail but we will be able to use it for
    testing the consequent integration steps.

    3) Batches in the form discussed below are added to Cayenne (yet not used by
    the commit until Step 5 is done)

    4) The referential graph gets switched from utilization of the JDBC metadata
    to the data map info.

    5) I will introduce my ContextCommit into Cayenne and integrate support for
    reflexives, flattened rels, delete rules.
        Important note: I briefly analysed the existing code for resolution of
    reflexive relationships. It is my belief we are able to handle the situation
    when there are several reflexive relationships per entity and this
    feature may be added to my current sorting-commit algorithm. I will use
    ashwood to implement this and it will be the first step in the direction of
    resolution of the cyclic dependencies.

    What do you think of all this?

    ==============================
    > I suggest moving
    > things around and renaming:
    >
    > 1. Batch -> query.BatchQuery extends AbstractQuery
    >
    > Extending abstract query will provide logging facility, root object,
    > and generally the way for Cayenne to handle batches as normal queries

    Agreed, makes plenty of sense.

    > 2. UpdateBatch, DeleteBatch, InsertBatch -> XyzBatchQuery extending
    BatchQuery.

    Agreed too

    > 3. I am still not sure how to integrate *QueryBuiders from the batch
    > package with our current QueryTranslators, so that DataNode would execute
    > batch queries kind of like it would normal queries (again, using standard
    > logging facilities, etc.) Need to look at that some more.
    >

    Maybe let them work for a while, and when the integration in whole is more
    or less complete we can take care of this little thing.

    Andriy.



    This archive was generated by hypermail 2.0.0 : Tue Jan 28 2003 - 08:20:16 EST