Bug: Transaction is Committed instead of Rollback'ed

Dave Peticolas dave@krondo.com
Wed, 14 Mar 2001 14:34:50 -0800


Derek Atkins writes:
> Dave Peticolas <dave@krondo.com> writes:
> 
> > Derek Atkins writes:
> > > Actually, I think I did just figure out the "right" way of doing this.
> > > Split out the force-change code into a second function,
> > > xaccTransDoRollback().  Then have xaccTransRollback() see if the
> > > backend has a rollback function; if so, just call that; if not, just
> > > call xaccTransDoRollback().  Then the backend can disable itself and
> > > then call the DoRollback() function to modify the engine without
> > > causing undue commit_edit calls.
> > 
> > Or put the backend detection in xaccTransRollback and then the backend
> > can choose to use xaccTransDoRollback without disabling itself?
> 
> I'm not convinced it would want to do that.  In the case where it runs
> gets through the force_it code, the transaction is changing locally
> but it's really not changed in the backend, so you dont need to
> 'commit' any changes anyways.

I guess I'm not sure what you mean. I thought you intended the
xaccTransDoRollback function to do the changes to the local
transaction that xaccTransRollback does now (this is the bulk
of the function, not just the force_it code). Then xaccTransRollback
would see if there is a backend implementation and, if so, call
that, otherwise it would just call xaccTransDoRollback directly.

dave