Termination "logic" - close all db resources when exiting the
application.