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:
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? 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
2. UpdateBatch, DeleteBatch, InsertBatch -> XyzBatchQuery extending BatchQuery.
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.
Andrus
At 12:23 PM 1/27/2003 -0500, Andrus Adamchik wrote:
>=======================================================================
>I still don't want to break the overall arcitecture, jumping the layers.
>So do you think we can create a special "ObjectModifyQuery extends
>AbstractQuery" and an optimized translator for it? I am thinking about
>the scenario like this:
>
>- DataContext will send (unordered) ObjectModifyQueries (can be
>insert/update/delete, can also be a batch) to DataDomain.
>
>- DataDomain will sort them by node.
>
>- Each DataNode will work with its own subset, sorting them any way
>appropriate, and using a special translator to avoid our complex
>expression translation code.
>
>Do you think this is still not optimized enough this way?
>
>
>Andrus
This archive was generated by hypermail 2.0.0 : Tue Jan 28 2003 - 01:09:46 EST