Re: Transaction logging without BEGIN WORK's
Posted in 1998
On Fri, 28 Aug 1998, H wrote: > I have always been part of a project that involves starting a database > with a transaction log and then coding programs with BEGIN WORK, ROLLBACK > WORK and COMMIT WORK to (hopefully) keep the database as resilient as > possible to any problems that might occur during processing. Good. > However, the database I am now working with has no transaction log > associated with it and none of the 130 or so programs that interrogate it > have any BEGIN WORK's etc...This strikes me as lunacy since it becomes > difficult to maintain database integrity. Bad. > I was speaking to the guy who originally developed the application and he > tells me that the database did originally have a transaction log but that > the programs were not coded with BEGIN WORK's etc...but that did not > matter. He said that if the system crashed they could still recover. Well, if they had a recovery plan, maybe it didn't matter. I'd have some doubts about the recovery plan, but if they had a viable plan, it should be OK. > I am a little unsure about this. I thought that if the database had a > transaction log you had to code programs to commit or rollback > transactions as necessary and then in the event of a system crash you > can be sure that a roll forward or rollback would work successfully. It depends on the logging mode. In a MODE ANSI database, then you would have to explicitly code the COMMIT WORK operation or any changes you made would be rolled back when the program terminated. In a non-ANSI database, if you do not start an explicit transaction, each separate statement is a separate transaction. This is essentially treating the logged database the same as an unlogged database -- you have to go to the recovery plan to recover if the system crashes after (say) 5 of the necessary 7 updates have been completed. > Is what he saying is this - that be having a transaction log with > coding the 4GL's with BEGIN WORK's etc then EVERYTHING is logged and > that your only option after a crash is to ROLLFORWARD everything?? I don't understand this question. Yours, Jonathan Leffler (jleffler@informix.com) #include <witticism.h> Guardian of DBD::Informix v0.60 -- http://www.perl.com/CPAN Informix IDN for D4GL & Linux -- http://www.informix.com/idn