begin transaction * all the changes that happend previously ... * This bit of updating llUpdate = tableupdate(.t.,.t.,"First Table") if not llUpdate rollback Else tablerevert all the changes done previously && not sure would be necessary if rolling back anyway! end transaction close the process && That logic is done in a separate method endifFirst of all, you can not do tablerevert inside transaction. Secondly, how this code is different from what I have posted and what is posted bellow (the actual code of my colleague). And how your suggestion was addressing the problem I stated? I don't see it, may be somebody else can.
>>>>IF !plFailed AND lnDupeCount <> lnTotal && Batch Transaction >>>> LOCAL llUpdate >>>> BEGIN TRANSACTION >>>> llUpdate = TABLEUPDATE(.T., .T., "load_patients") >>>> IF !llUpdate >>>> pcAlias = "load_patients" >>>> ENDIF >>>> IF llUpdate >>>> ... >>>> IF llUpdate >>>> END TRANSACTION >>>> ELSE >>>> ROLLBACK >>>> LOCAL ARRAY laError[1] >>>> LOCAL lcError >>>> =AERROR(laError) >>>> lcError = [ Error: ] + ALLTRIM(STR(laError[1])) + "," + ; >>>> [ Message: ] + ALLTRIM(laError[2]) >>>> =Log_error(lcError, pcAlias) >>>> ENDIF >>>>ELSE >>>> LOCAL lcError >>>> IF VARTYPE(poException) = "O" >>>> lcError = [ Error: ] + ALLTRIM(STR(poException.ERRORNO)) + "," + ; >>>> [ Line No: ] + ALLTRIM(STR(poException.LINENO)) + "," + ; >>>> [ Message: ] + ALLTRIM(poException.MESSAGE) + "," + ; >>>> [ Procedure: ] + ALLTRIM(poException.PROCEDURE) >>>> =Log_error(lcError, pcAlias) >>>> ENDIF >>>>ENDIF >>>>>>>>
>>>>>begin transaction >>>>> llUpdate = tableupdate(.t.,.t.,"First Table") >>>>> if not llUpdate >>>>> rollback >>>>> tablerevert all the changes done previously >>>>> close the process && That logic is done in a separate method >>>>> endif >>>>> ... >>>>>end transaction >>>>>>>>>>What happens in the 'close the process' method and the .... section that takes so long?