> >BEGIN TRANSACTION > >Select tabela1 >=TableUpdate(1,.T.) >FLUSH > >Select tabela2 >=TableUpdate(1,.T.) >FLUSH > >Select tabela3 >=TableUpdate(1,.T.) >FLUSH > >IF TableUpdate(.T., .F., "Tabela1") ; > and TableUpdate(.T., .F., "Tabela2") ; > and TableUpdate(.T., .F., "Tabela3") > END TRANSACTION >ELSE > ROLLBACK >ENDIF > >É melhor usar um só TableUpdate(). O TableUpdate() adicional é superfluo.
BEGIN TRANSACTION IF TableUpdate(.T., .F., "Tabela1") ; and TableUpdate(.T., .F., "Tabela2") ; and TableUpdate(.T., .F., "Tabela3") END TRANSACTION ELSE ROLLBACK ENDIF FLUSHComo nao passa muito tempo entre um TableUpdate() e outro, pode usar um só FLUSH. A idea geral é que não passe muito tempo entre a atualizaçao no disco, e o FLUSH.
BEGIN TRANSACTION local llSuccess llSuccess = TableUpdate(.T., .F., "Tabela1") FLUSH if llSuccess llSuccess = TableUpdate(.T., .F., "Tabela2") FLUSH endif if llSuccess llSuccess = TableUpdate(.T., .F., "Tabela3") FLUSH endif if llSuccess END TRANSACTION else ROLLBACK endifO ROLLBACK anulará todos os cambios às tres tabelas.