Re: Child Contexts

From: Michael Gentry (mgentr..asslight.net)
Date: Tue Sep 21 2010 - 18:38:24 UTC

  • Next message: br..olos.pt: "Re: Child Contexts"

    Hi Bruno,

    The Child DataContext *might* share the same database connection as
    the Parent DataContext. In general, you don't care about this,
    though. The DataContext, on commitChanges(), will request a database
    connection, use that connection for performing the commit, then return
    the connection back to the pool. It isn't required that the same
    database connection be used between a performQuery() and a
    commitChanges().

    If you do commitChanges() on a Child DataContext, it pushes the
    changes to the Parent DataContext and to the database. If you only
    want the changes to go to the Parent DataContext and *not* the
    database, use commitChangesToParent().

    mrg

    On Tue, Sep 21, 2010 at 2:22 PM, <br..olos.pt> wrote:
    > Hello all,
    >
    > Do Child Contexts share the connection of a parent connection? When i do a
    > commitChanges on the child the change is made on the database or in the
    > parent? I have already read the Nested Contexts page on the User Guide but
    > this detail was confusing for me.
    >
    > Thank you
    > Bruno
    >
    >



    This archive was generated by hypermail 2.0.0 : Tue Sep 21 2010 - 18:39:30 UTC