I have a bunch of utility procedures that check only some conditions in the database and return the flag result. These procedures are executed with a READ UNCOMMITTED isolation level equivalent to WITH WITH NOLOCK.
I also have more complex procedures that run with the SERIALIZABLE isolation level. They also have the same checks in them.
Therefore, I decided to call these verification procedures from these complex procedures instead of replicating the verification code.
It basically looks like this:
CREATE PROCEDURE [dbo].[CheckSomething]
AS
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
BEGIN TRANSACTION
COMMIT TRANSACTION
and
CREATE PROCEDURE [dbo].[DoSomethingImportant]
AS
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
BEGIN TRANSACTION
EXECUTE [dbo].[CheckSomething]
COMMIT TRANSACTION
Would it be nice to do this? Will a temporarily activated lower isolation level somehow violate a higher level of protection or is everything safe?
EDIT: - .