If databaseName != temp use databaseName

Connections will be closed in methods if databaseName != temp. This will
result in not having to modify code for optimizations that uses
databaseName and not Connection