Adjust db code for concurrent calls