Re: Cay-256 / object invalidation

From: Cris Daniluk (cris.danilu..mail.com)
Date: Tue Oct 11 2005 - 17:03:12 EDT

  • Next message: Mike Kienenberger: "Re: Cay-256 / object invalidation"

    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:03:13 EDT