>To handle such situation I have the routine in my error handler which sets a 10-attempt loop with RETRY, and asks what to do after this (if it is still not locked).
The loop inside the error handler is good. Howerver, for the decision, I can't rely on a user response. This is from the Web framework application. :)