Re: Error when adding and then removing object from relationship before committing

From: Brian Nelson (briannelson2..ahoo.com)
Date: Thu May 01 2008 - 01:07:42 EDT

  • Next message: Brian Nelson: "Re: Error when adding and then removing object from relationship before committing"

    Thanks so much for the fast response. Now what is the best way for me to get the latest cayenne so
    I can test this in my application?

    Brian

    --- Andrus Adamchik <andru..bjectstyle.org> wrote:

    > Hi Brian,
    >
    > On Apr 30, 2008, at 8:04 AM, Brian Nelson wrote:
    >
    > > Let me start this post by thanking the Cayenne dev team for their
    > > great work. The project I'm
    > > working on switched from Hibernate to Cayenne several months ago. I
    > > can honestly say the decision
    > > to switch is one of the best things that ever happened to my project.
    >
    > Cool. Would be nice to hear the details ;-)
    >
    >
    > > Now on to my problem...
    > >
    > > I have a situation where I
    > >
    > > 1. Add a newly created object to a relationship.
    > >
    > > EstimateRoom room = context.newObject(EstimateRoom.class);
    > >
    > > // Several lines configuring variables in room
    > >
    > > floorModel.getEstimate().addToRooms(room);
    > >
    > > 2. Remove the object from the relationship
    > >
    > > estimate.removeFromRooms(obj);
    > > context.deleteObject(obj);
    > >
    > > 3. Attempt to commit to the parent DataContext
    > >
    > > This works as long as the object is the last element contained in
    > > the List maintaining the
    > > relationship. If it is in the middle of the List(I sort the list
    > > after the room is inserted) then
    > > I receive the following exception.
    >
    > This turned out to be a bug. I already committed the fix. It will be a
    > part of M4:
    >
    > https://issues.apache.org/cayenne/browse/CAY-1044
    >
    > Andrus
    >



    This archive was generated by hypermail 2.0.0 : Thu May 01 2008 - 01:08:18 EDT