Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-592

Modifying an object that has a to one relationship to an object that uses inheritance, breaks the relationship.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.2 branch
    • 1.2 branch
    • Core Library
    • None

    Description

      First reported here: http://objectstyle.org/cayenne/lists/cayenne-user/2006/07/0020.html

      A unit test to reproduce (part of InheritanceTst class):

      public void testCAY592() throws Exception

      { createTestData("testManagerAddress"); List addresses = context.performQuery(new SelectQuery(Address.class)); assertEquals(1, addresses.size()); Address address = (Address) addresses.get(0); Employee e = address.getToEmployee(); // CAY-592 - make sure modification of the address in a parallel context // doesn't tmess up the Manager DataContext c2 = context.getParentDataDomain().createDataContext(); e = (Employee) DataObjectUtils.objectForPK(c2, e.getObjectId()); address = (Address) e.getAddresses().get(0); assertSame(e, address.getToEmployee()); address.setCity("XYZ"); assertSame(e, address.getToEmployee()); }

      Attachments

        Activity

          People

            andrus Andrus Adamchik
            andrus Andrus Adamchik
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: