Re: "Saving" changes to an object's variable(s) but not save changes to database.
Peter Vandoros <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Tony, If i understand you correctly, an easy way to do what you want is to create a new EOEditingContext and fetch your objects into it. Then let the user enter the form data and submit it (which automatically sets the values in the EOEnterpriseObjects without saving to the database). In the action method that is bound to your form submit button, initialise the next page and pass the array of EO's you have already fetched. As long as you don't call saveChanges() on your new editing context, the changes will not be committed to the database. Also, the editing context and its objects will get garbage collected automatically when the pages it is referenced from is removed the session page cache. The only thing you have to worry about is locking your editing context correctly as to avoid a deadlock. I recommend you use the MultiECLockManager from http://sourceforge.net/projects/gvcsitemaker/ regards Peter Tony Hoffman wrote: I have what may be such a profoundly stupid question that it may need to be ignored by all. I've gone through my books and the list and Google searches and I still can't find anything that gets me even close to the answer (also usually a big tip off that my question/and or thinking is deeply misguided). My problem is basically this: I want users of my web application to be able to make form input changes into the variable value of each instance of an object generated from an EOFetchspecification. And then I want to be able to save these values in the session so that I can move it between components, refer to it, and then have it disappear at the end of the session without ever bothering the database again. If I were to use the saveChanges method on the editingcontext for this NSMutableArray of objects and its input variables, everything works fine, but I don't want to save changes to the database, I want to save changes to the (temporary) values in the variable in the objects held in the session. I have the WOTextFields just sitting there. All I want to do is link them up with some kind of action method that will record the user input into the object variables in the session WITHOUT saving those changes to the database. It seems so basic that I have to ask, what am I missing? _______________________________________________ WebObjects-dev mailing list [email protected] http://www.omnigroup.com/mailman/listinfo/webobjects-dev _______________________________________________ WebObjects-dev mailing list [email protected] http://www.omnigroup.com/mailman/listinfo/webobjects-dev