Enable threadlocals for database