[JIRA] Created: (CAY-742) Client CayenneContext doesn't evict objects after delete

From: Andrus Adamchik (JIRA) ("Andrus)
Date: Mon Jan 29 2007 - 09:47:50 EST

  • Next message: Malcolm Edgar: "DbEntity Comments"

    Client CayenneContext doesn't evict objects after delete
    --------------------------------------------------------

                     Key: CAY-742
                     URL: https://issues.apache.org/cayenne/browse/CAY-742
                 Project: Cayenne
              Issue Type: Bug
              Components: Cayenne Core Library
        Affects Versions: 3.0
                Reporter: Andrus Adamchik
             Assigned To: Andrus Adamchik
                 Fix For: 3.0

    Per http://objectstyle.org/cayenne/lists/cayenne-user/2007/01/0078.html client cayenne context doesn't properly reset the state of deleted objects (context is not null). When I tried to test it using the trunk version of 3.0, I stumbled upon a slightly different problem - a deleted object is not evicted from the context GraphManager (it sits there in transient state). Need to investigate that more.

    CayenneContextWithDataContextTest.java:
        public void testDelete() throws Exception {
            deleteTestData();

            UnitLocalConnection connection = new UnitLocalConnection(new ClientServerChannel(
                    getDomain()), LocalConnection.HESSIAN_SERIALIZATION);
            ClientChannel channel = new ClientChannel(connection);
            CayenneContext context = new CayenneContext(channel);
           

            ClientMtTable1 o = (ClientMtTable1) context.newObject(ClientMtTable1.class);
            o.setServerAttribute1("S1");

            context.commitChanges();

            context.deleteObject(o);
            assertSame(context, o.getObjectContext());
            context.commitChanges();
            
            assertNull(o.getObjectContext());
    // **** THIS FAILS ****
            assertNull(context.getGraphManager().getNode(o.getObjectId()));
        }

    -- 
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
    



    This archive was generated by hypermail 2.0.0 : Mon Jan 29 2007 - 09:48:16 EST