Re: ROLLBACK vs COMMIT when nothing done
Posted in 1994
In article <stuart.775183016@coral>, stuart@coral.cs.jcu.edu.au (Stuart Kemp) wrote: > Given the situation where you BEGIN WORK and shortly thereafter you > want to end the transaction *but nothing has been altered*, WRT efficiency > is it better to COMMIT or ROLLBACK? > > e.g. > > FUNCTION xyz() > BEGIN WORK > IF (NOT LockSomeRecord()) -- Failed > ROLLBACK WORK -- Better to COMMIT? > RETURN > END IF > > ... > COMMIT WORK > END FUNCTION My understanding is that Informix always assumes the best, so that COMMIT WORK just releases any locks, while a ROLLBACK WORK needs to trundle back thru the transaction and "undo" everything. ------------------------------------------------ Kerry Sainsbury, kerry@kcbbs.gen.nz R&D Dude, Quanta Systems, Auckland, New Zealand ph. +64 9 377-4473 (work). +64 9 276-5546 (home) -------------------------------------------------