def __del__(self):
try:<EOL><INDENT>if self.is_alive()["<STR_LIT>"]:<EOL><INDENT>self.close()<EOL><DEDENT><DEDENT>except Exception:<EOL><INDENT>pass<EOL><DEDENT>
This method is used to cleanup when the program is terminated suddenly.
We need to make sure the connection is closed properly and the configuration DB
is released (unlocked).