F
frank.meulblok
Guest
The short version why the error repeats: - Because the temp-table is no-undo the 2nd record stays in the buffer. (if the temp-table is undoable AND a transaction is active the buffer will be emptied while the record is undone). - The AVM tries to flush buffers that moved out of scope at certain points. (Such as when a procedure ends.) And it validates the current contents when doing so to prevent the underlying table from going into an inconsistent state. Every time such a flush happens, the error will be raised again and the buffer sticks around because it can't be flushed correctly. Two ways to avoid this: 1. Make the temp-table undoable and wrap any activity on it in a transaction. Which is probably not the most efficient way, and may introduce transaction scoping issues as a side effect. 2. In the block where you create temp-table records, CATCH any error that occurs. Then in the CATCH block delete the record and re-throw the exception. (Re-throwing is under the assumption that you *do* want the initial error to remain visible to the rest of your code )
Continue reading...
Continue reading...