Re: caching problem ?

From: WONDER (mmmmmmmmm5..eb.de)
Date: Wed Mar 15 2006 - 06:43:24 EST

  • Next message: Lothar Krenzien: "Re: caching problem ?"

    Hello,
    I am not really sure if Cayenne commits the changes as Atomic unit but first
    i would check this.

    So, Your problem is you want to be sure that changes in tableA as well as
    tableB must be written or none.

    usually this should do the job:
    Change object from tableA,
    Change object from tableB,
    DataContext.commitChanges(); // You must be sure the changes from obejctA,
    objectB are in the same DC.
    // maybe another constellation would also work. however. ...

    Cayanne "would" keep the changes in sync, All or nothing.
    Did you try this?

    Of course what you explained should work anyway, i cant see any problem in
    write/read/write sequence.

    Sako.
    ----- Original Message -----
    From: "Lothar Krenzien" <lkrenzie..eb.de>
    To: <cayenne-use..bjectstyle.org>
    Sent: Wednesday, March 15, 2006 12:18 PM
    Subject: caching problem ?

    > Hi ,
    >
    > I've notified a problem which I don't really understand.
    >
    > I'm doing an insert into tableA, read from tableA and insert the data into
    tableB. Because I want to save all or nothing I commit the transaction after
    the last insert. But it looks like that insert data in tableA are not found
    after the insert because the data in tableB were not inserted. In the
    logfile I can see that the select don't return any data. When I commit the
    transaction after inserting into tableA it seems to work. But that's not
    what I want. So could it be a caching problem ? And I get no error from the
    database.
    >
    > Here's an example of what I want to do:
    >
    > insert into tableA
    > read from tableA
    > insert the just read data into tableB
    > commit
    >
    > cayenne 1.2 M10 + MSSQL 2000 + jtds
    >
    > Thanks, Lothar
    >
    > P.S: I've just read about caching in the cayenne user guide
    (http://www.objectstyle.org/cayenne/userguide/fetch/result-caching.html). I
    there a way to set the caching policy once for all queries ? In the cayenne
    modeler the option 'Use shared cache' is set for the used domain node.
    > ______________________________________________________________________
    > XXL-Speicher, PC-Virenschutz, Spartarife & mehr: Nur im WEB.DE Club!
    > Jetzt gratis testen! http://freemail.web.de/home/landingpad/?mc=021130
    >
    >



    This archive was generated by hypermail 2.0.0 : Wed Mar 15 2006 - 06:43:55 EST