Re: Cay-256 / object invalidation

From: Mike Kienenberger (mkienen..mail.com)
Date: Tue Oct 11 2005 - 17:09:48 EDT

  • Next message: Cris Daniluk: "Re: Cay-256 / object invalidation"

    One thing to keep in mind is that there's a race condition here. It
    takes time to propagate the change.

    What happens if you put in a "sleep(5000)" after the invalidate?

    -Mike

    On 10/11/05, Cris Daniluk <cris.danilu..mail.com> wrote:
    > Easier to explain through code probably...
    >
    > public void testInvalidateObjectsMergeSnapshots() throws Exception{
    >
    > TestCaseDataFactory.createArtist(
    > "testInvalidateObjectsMergeSnapshots");
    >
    > DataContext altContext = createAltContext();
    >
    > // Retrieve the artist in both contexts...
    > Artist artist = fetchArtist("testInvalidateObjectsMergeSnapshots");
    > Artist altArtist =
    > fetchArtist("testInvalidateObjectsMergeSnapshots", altContext);
    >
    > assertEquals(artist.getPersistenceState(),
    > altArtist.getPersistenceState());
    >
    > Date now = new Date();
    > artist.setDateOfBirth(now);
    > altArtist.setArtistName("nameToAccept");
    >
    > altContext.commitChanges();
    >
    > context.invalidateObjects(Collections.singleton(artist));
    > assertEquals("nameToAccept", artist.getArtistName());
    >
    > }
    >
    > This doesn't work. In other words, when I invalidate an object, it
    > reverts to the original snapshot. It does NOT refresh the snapshot
    > from the database.
    >
    >
    > On 10/11/05, Mike Kienenberger <mkienen..mail.com> wrote:
    > > Not quite sure what you're asking. (Sorry for the late response, but
    > > I've been sick).
    > >
    > > On 10/6/05, Cris Daniluk <cris.danilu..mail.com> wrote:
    > > > While applying the patch for Cay-256 to the 1.1 branch, I noticed that
    > > > it doesn't seem to be behaving as advertised. Basically, it seems like
    > > > the invalidated object is falling back on its original snapshot,
    > > > rather than refetching from the database.
    > > >
    > > > Is this correct behavior? Based on the bug note in Cay-256, I'm led to
    > > > believe otherwise..
    > > >
    > > > Cris
    > > >
    > >
    >



    This archive was generated by hypermail 2.0.0 : Tue Oct 11 2005 - 17:09:49 EDT