USE ASPStateGO ALTER PROCEDURE dbo.TempGetAppID @appName tAppName, @appId int OUTPUT AS -- start change -- Use the application name specified in the connection for the appname if specified -- This allows us to share session between sites just by making sure they have the -- the same application name in the connection string. DECLARE @connStrAppName nvarchar(50) SET @connStrAppName = APP_NAME() -- .NET SQLClient Data Provider is the default application name for .NET apps IF (@connStrAppName <> '.NET SQLClient Data Provider') SET @appName = @connStrAppName -- end change SET @appName = LOWER(@appName) SET @appId = NULL SELECT @appId = AppId FROM [ASPState].dbo.ASPStateTempApplications WHERE AppName = @appName IF @appId IS NULL BEGIN BEGIN TRAN SELECT @appId = AppId FROM [ASPState].dbo.ASPStateTempApplications WITH (TABLOCKX) WHERE AppName = @appName IF @appId IS NULL BEGIN EXEC GetHashCode @appName, @appId OUTPUT INSERT [ASPState].dbo.ASPStateTempApplications VALUES (@appId, @appName) IF @@ERROR = 2627 BEGIN DECLARE @dupApp tAppName SELECT @dupApp = RTRIM(AppName) FROM [ASPState].dbo.ASPStateTempApplications WHERE AppId = @appId RAISERROR('SQL session state fatal error: hash-code collision between applications ''%s'' and ''%s''. Please rename the 1st application to resolve the problem.', 18, 1, @appName, @dupApp) END END COMMIT END RETURN 0 GO
Remember Me
a@href@title, strike
Powered by: newtelligence dasBlog 2.1.8102.813
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2010, Shawn Neal
E-mail