Good morning Sebastian,
first of all thank you very much for the detailed answer, I think I have now understood the subject.
The idea with the try catch block already came to me, but I think I’ll try your second suggestion with the direct database access. Thanks also for that, it helped me a lot. 
Best regards, Max