問題文
A subscription billing app stops a trigger from re-entering itself with a static Boolean that is set to true on the first pass. Support now reports that when a data load updates the same subscription twice in one request, the second update's logic never runs. What should replace the guard?
選択肢
- A custom setting that an administrator switches off before a data load and back on afterwards; the guard is not needed during the load during it and the logic runs for each update the load performs.
- A check on the recursion depth, comparing the current stack depth against the ceiling of 16 that applies when a trigger fires itself through a data manipulation statement, and skipping when it is close.
- Nothing, because the static Boolean is reset between the updates in the same request and the reported behavior must have another cause somewhere else in the handler class it calls.
- A static Set of the record Ids already processed, so the handler skips only the records it has genuinely handled and still processes every other record in the same transaction.