1. fix the nesting lock of db and txn 2. the txn of task will be init in task scheduler before take task from queue