Re: Memory and performance many new objects

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Aug 13 2009 - 07:04:15 EDT

  • Next message: Andrus Adamchik: "Re: Example of getting data from non-JDBC datasource?"

    On Aug 13, 2009, at 12:36 PM, Andreas Hartmann wrote:

    >
    > Of course I could commit the transaction each 1000 rows or so, but
    > I'd rather commit the whole spreadsheet to the DB in a single
    > transaction.

    You can use user-defined transaction scope, then committing every 1000
    rows will allow Java side garbage collection on them, while the entire
    spreadsheet will load atomically (unless of course your DB does not
    support ACID transactions, i.e. MySQL MyISAM and such) :

    http://cayenne.apache.org/doc/understanding-transactions.html

    Also I should note that if you are not on Cayenne 3.0 yet, that has
    self-cleaning DataContexts, you will also need to replace a
    DataContext after each commit.

    Andrus



    This archive was generated by hypermail 2.0.0 : Thu Aug 13 2009 - 07:04:51 EDT