Let\'s assume there is an operation that creates a user. This operation may fail if specified email or username exists. If it has failed, it is required to know exactly why. The
You specified that UserExists
and UsernameExists
both make DB calls. I'll assume that CreateUser
also makes a database call.
Why not let the database handle your threading issues? Assuming further that there are proper constraints set up on your table(s), you can let it err-out within a stored proc call.
Therefore, I'll cast my vote for Create-Catch.