Bug fix: per thread db connection.