a query does not see newly inserted objects?

From: Marc Guenther (yod..chli.ch)
Date: Tue Oct 12 2010 - 13:34:53 UTC

  • Next message: ЄЖЄRSoN CმStმNЄDმ : "Re: Some questions"

    Hi,

    maybe that's a stupid question, but is there a way to make a query aware of newly inserted objects?

    I have a DataContext. I insert some object into it (a user), and then, without committing the context to the DB, I query it for all users. The newly inserted user does not show up.

    The query is a normal SelectQuery. I tried playing around with caching strategies and isRefreshingObjects, but it didn't work.

    Is this the expected behaviour? Is it even possible to do this?

    I tried this, because I have a process which does lots of small changes, and some of the later ones depend on former changes. At the moment I commit every change into the DB at once, but I wanted to delay that till everything is finished, and then do it in one big commit.

    So I tried to setup a parent/child context, and commit only to the parent in the child. But then I get failures later in the process cause the earlier changes are not visible to it.

    Marc



    This archive was generated by hypermail 2.0.0 : Tue Oct 12 2010 - 13:35:35 UTC