Reconnect to database on every task.