Re: Synchronization after SQLTemplate

From: Cris Daniluk (cris.danilu..mail.com)
Date: Mon Sep 05 2005 - 17:05:23 EDT

  • Next message: Gili: "Re: Synchronization after SQLTemplate"

    http://objectstyle.org/cayenne/api/cayenne/index.html

    I can't think of a single reason not to have DeleteQuery in your
    Cayenne toolbox. SQLTemplate may be more appropriate for what you're
    doing (I have no idea), but DeleteQuery is definitely an affective way
    to delete bulk data while preserving the integrity of the object graph

    Cris

    On 9/5/05, Gili <cowwo..bs.darktech.org> wrote:
    >
    > I believe Andrus mentioned I should only be using the standard three
    > types of queries (there are no guarantees if I use anything else) and
    > DeleteQuery wasn't one of them.
    >
    > The method you mention in this and the previous email seem to require
    > the operation to occur on the application-end. For performance reasons,
    > I really would prefer running all of this directly on the server.
    >
    > Gili
    >
    > Cris Daniluk wrote:
    > > I would store a separate collection of the objects you deleted, then
    > > invalidate them from the cache. Even still though, I'm not sure that
    > > this would catch all relationships and whatnot (it will probably just
    > > reset relationships back to hollow).
    > >
    > > Couldn't you just use DeleteQuery?
    > >
    > > Cris
    > >
    > > On 9/4/05, Gili <cowwo..bs.darktech.org> wrote:
    > >
    > >>Hi,
    > >>
    > >> http://www.objectstyle.org/cayenne/userguide/fetch/sqltemplate.html
    > >>mentions that ObjectStore might be inconsistent after a SQLTemplate, but
    > >>what are we supposed to do then? In Hibernate one would invoke
    > >>session.flush() which forces the synchronization of all cached objects
    > >>with the DB. Does Cayenne have an equivilent method?
    > >>
    > >> I want to be able to bulk-delete objects using SQLTemplate (as opposed
    > >>to using a SelectQuery) for performance reasons and then update the
    > >>cache so I can continue within the same data context.
    > >>
    > >>Gili
    > >>--
    > >>http://www.desktopbeautifier.com/
    > >>
    > >
    > >
    >
    > --
    > http://www.desktopbeautifier.com/
    >



    This archive was generated by hypermail 2.0.0 : Mon Sep 05 2005 - 17:05:25 EDT