Answered Update DB in CATCH block?

Cringer

ProgressTalk.com Moderator
Staff member
Progress 11.2 on Win7.
Is it possible to update the database in a CATCH block or will the changes back out? I am thinking about implementing a method of capturing errors users receive so that we can use it for problem determination. We have a lot of users who don't report error messages accurately and as a result it gets pretty hard to determine where they are going wrong.
 

RealHeavyDude

Well-Known Member
As far as I am concerned the logic that fires within a catch block can be any valid ABL - and therefore one should be able to update the database in it. But I have to admit that I've never tried that. IMHO it is a NOGO. The chances that something goes wrong in the statements that get executed in a catch block should be minimal because you won't have any structured or reasonable error handling. If I remember correctly there is even a statement on that in the documentation on the structured error handling that says something like that.

I also think that the same applies for the FINALLY block. If I were you I would set an okay flag to false in the CATCH block and would handle that accordingly outside the block to which that CATCH block applies. I do something like that very often and it gives me chance to use the structured error handling on that as well.

Heavy Regards, RealHeavyDude.
 
Top