fix bug: if we reset connection in context, then program will crash when we call context->connection()->..., though we always set the connection back after reset, because there is no lock on context, we cannot guarantee the clear-then-set operation is atomic
enhance debug log