I have code (runtime between 1 and 2 seconds) which I want to run everytime the computer shuts itself down (logging off a user out of a another system on another server).
I have already tried to add it to the ShutdownHook
but the execution of the overgiven Thread is to slow - the thread gets killed before all commands could be executed.
Also tried to add it to a finally statement, that didn't help anything too.
What is IYO common practise for that case?
THX a lot.