From: Carl Youngblood Date: 2004-06-05T00:44:52+09:00 Subject: Re: [ANN] Active Record 0.8.0: Transaction that! Gavin Kistner wrote: > On Jun 2, 2004, at 9:34 AM, Carl Youngblood wrote: > >> David Heinemeier Hansson wrote: >> >>> Be aware, though, that the objects will not have their instance >>> data returned to their state before the transaction started. You�ll >>> have to deal with that yourself (just as in the case of >>> Validations). Also have in mind that exceptions thrown within a >>> transaction block will be propagated (after triggering the >>> ROLLBACK), so you should be ready to catch those in your >>> application code. >> >> >> Is this for performance reasons? It seems like it wouldn't be too >> hard to undo the changes to instance data if an exception were thrown. > > > I could actually see an usefulness to the current > (non-instance-rollback) mechanism: > > If the transaction fails, your code can look at various instances and > see which ones worked (the instance is the same as what you attempted > to set it to) and thus at which point exactly it failed (the instance > never got set). Didn't David say that you can still do it the old way by just not passing parameters? So your problem is already solved. Carl