In Java utilizing logging, I run the handler in init () and close the handler in destroy (), and it works fine: the log file was created, etc. If the user refreshes the page as usual, it still just creates a single log file.
However, if the user refreshes the page several times using the applet, it seems that destroy () has not been called or may not have completed the task, and since init () is called again, it assumes the previous file is still locked and creates a new log file.
I tried using both destroy () and finalize () to close the handler, but it does not work. Does anyone know how to solve this problem?
Another minor question: what actually happened if init () did not finish and the page was refreshed. Will it continue the process and, in the end, will not be able to call destroy (), or will it just stop right there?
source
share