Please try SaveAndFlush() instead of Save(). -Markus
2009/8/20 Sybaris <[email protected]> > > Hi everybody, > > I'm using Castle Active Record as OR/Mapper in the project I'm > currently working on. Everything works fine so far but there's one > little issue that I'm not sure of - or at least I'm not sure if I'm > using it correctly: > > That's the situation: > I'm creating a transaction (-scope). > I'm creating a (AR-) object. > I'm opening a (generic) dialog to give the user the chance to edit the > newly created object. > The user enters data and presses OK which leads to a Save(). > The user opens the dialog again, edits the data and presses OK again > (the object is therefore saved again). The object holds the new data > now. > The user opens the dialog again, edits the data and this time presses > Cancel which leads to a Refresh(). > > The problem now is that the call to Refresh() reverts the object's > data to the state BEFORE the second Save(). That means I'm getting the > initial state from the first Save(). > (The transaction is still not comitted at this time - and it can't be > comitted because this dialog is part of a wizard with several pages > and the transaction ain't complete until the user presses "Finish") > > Is there a way to tell CAR to always take the last Save() as the > "current object state" and to fall back to this state when Refresh() > is called? > > Thanks in advance! > > G. > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Users" 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/castle-project-users?hl=en -~----------~----~----~----~------~----~------~--~---
