Mutex db calls in the parallel code