Re: caching problem ?

From: Lothar Krenzien (lkrenzie..eb.de)
Date: Wed Mar 15 2006 - 10:43:07 EST

  • Next message: Tomas Jucius: "Re: bug in objectId generation?"

    Thanks for the explanation. In the meantime I've found a good overview of transactions (http://www.objectstyle.org/confluence/display/CAYDOC/Understanding+Transactions) . But I will now implement an easier solution and passing the newly created object as parameter.

    > -----Ursprüngliche Nachricht-----
    > Von: cayenne-use..bjectstyle.org
    > Gesendet: 15.03.06 16:19:18
    > An: cayenne-use..bjectstyle.org
    > Betreff: Re: caching problem ?

    > You won't see an uncommitted object in SelectQuery results. This has
    > nothing to do with SelectQuery caching. One possible solution to that
    > is manual transaction management (I suggest you use M11 for that ...
    > if it doesn't work - nightly build, as there were some recent
    > improvements)
    >
    > http://objectstyle.org/confluence/display/CAYDOC/Understanding
    > +Transactions
    >
    > (see "User-Defined Transaction Scope" in the bottom). You can
    > implement that "try" block from that Wiki example as follows:
    >
    >
    > * insert
    > * commit DataContext (this will flush changes to DB, but will NOT
    > commit DB transaction because it is "external").
    > * read from tableA
    > * insert the just read data into tableB
    > * commit DataContext (again this will be just flush, not commit)
    >
    > Andrus
    >
    > On Mar 15, 2006, at 2:18 PM, Lothar Krenzien wrote:
    >
    > > 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
    > >
    > >
    >

    ______________________________________________________________________
    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 - 10:43:11 EST