Make sure db is open at all times (caused problems when sorting query started from the command line)
Authored by: dockes 2009-08-13
Parent(s): [a9eb8e]
Child(ren): [ce2d3c]