made change to explicitly close database sessions

In order to eliminate an exception being thrown by the SQLite database,
explicit calls to close the various database sessions were added to make
sure that all database connections were being closed once the session
was no longer needed