Re: large data loads - best practices ?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Apr 24 2003 - 15:44:29 EDT

  • Next message: Andrus Adamchik: "Re: One to many relationships require reverse relationships?"

    > Read pre-staging table and load all objects into context.
    > Query staging table for object (if exists update, else insert)
    > Map objects into staging-table.
    >
    > I will try the unregister. We have been simply dropping the context and
    > getting a new one. (Guess that isn't the best way to go about it?

    Well, it depends. "unregister" is good for fine tuning to improve
    performance when lots of related objects are fetched. But it is more work
    to implement. If you simply read objects from one table, without using any
    expensive relationship fetches, doing it your way (by recreating
    DataContext) is actually the best bet.

    This is of course if I understood you correctly, and you DO NOT replace
    the context for each saved row.

    > Would this simply grab the same context?

    No, if you are doing something along the lines of
    DataContext.createDataContext(), this will give you a new context, freeing
    memory from the old one.

    Andrus



    This archive was generated by hypermail 2.0.0 : Thu Apr 24 2003 - 15:44:30 EDT