mutex and database