fix database access conflict on some concurrency circumstance