No, the (composed) object in the session is always in the Transfer cache. This is why the values should be the same AFAICT. The relationship looks like:
member o2m ---> clubmembership <--- m2o attendee Before you can get to having a session.attendee, you must have a clubmembership. However, you could migrate away from the event registration, update your membership, and return. This is the scenario where the two values are not the same. In short, session.attendee.getClubMembership() (a m2o) is not returning the same object as member.getClubMembership() (a o2m). Here's the revised code that is working (but the discard has some performance penalties that I'm looking to avoid for larger relationships): mem = member.clone(); clubmem = mem.getClubMembership(clubid); clubmem.set*(x,y,z); if (not clubmem.validate()) // report errors to user else transfer.save(clubmem); transfer.discard(clubmem); // new transfer.discard(clubmem.getParentMember()); // new With these discards, session.attendee.getClubMembership().getMemberID() is now equal to member.getClubMembership(clubid).getMemberID() I don't believe I should need to use discard in this method because saving the object should synchronize with the Transfer cache which would update the TO that attendee.getClubMembership() returns, right? Brian On Jun 2, 10:36 pm, Mark Mandel <[email protected]> wrote: > Basically, I think the issue boils down to this - the object you have in > session may, or may not be in the Transfer cache. > > So it may not be updated when the TO in the Transfer cache gets updated. > > This is where I would just store the ID of the object you reference in > session, and let Transfer manage the session. > > Does that work? Or did I miss the point of this? -- Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer Try out the new Transfer ORM Custom Google Search: http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8 You received this message because you are subscribed to the Google Groups "transfer-dev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en
