Dispose of database objects properly