Prevent a deadlock from within inDatabase callback