CLR Integration and Lightweight Pooling Conflict

I thought I am CLR Integration Guru in Sql Server but this morning I came to know that there are lots of things left to grab. While I was moving the local database on the new live server I run some CLR Procedure which Says these procedures required CLR Integration enabled. So to get that done.

I went on SQL Server Surface Area Configuration -> Surface Area configuration for features -> Enable CLR Integration. till here, every thing seems fine I encounter no error.

After that when I re-execute the same query I get a new error:

“Invalid connection (Common language
runtime (CLR) execution is not supported under lightweight pooling.
Disable one of two options: “clr enabled or “lightweight pooling”.

I really have no idea what the light weight pooling is but the need of the time is to disable it. After googling for a bit I get this link. but still no use as the query written in this page is not working infact it is giving error.

   1: sp_configure ’show advanced options’, 1;
   2: GO
   3: sp_configure ‘lightweightpooling’, 0;
   4: GO
   5: RECONFIGURE;
   6: GO

Error:
The configuration option ‘lightweightpooling’ does not exist, or it may be an advanced option.

To find what is going wrong, I quried on sys.configurations because this table contain database configuration.

   1: select * from sys.configurations where name like ‘%light%’

Finally, after running the above query I came to know that there is a space in ‘lightweightpooling’. It means it is ‘lightweight pooling. Now when I diagnose the problem I execute the following query which make my sql server CLR Integrated.

   1: USE master
   2: GO
   3: EXEC sp_configure ’show advanced options’, 1
   4: GO
   5: RECONFIGURE WITH OVERRIDE
   6: GO
   7: EXEC sp_configure ‘lightweight pooling’, 0
   8: GO
   9: EXEC sp_configure ‘clr enabled’, 1
  10: go
  11: RECONFIGURE WITH OVERRIDE
  12: GO
  13: EXEC sp_configure ’show advanced options’, 0
  14: GO

After executing the query, we might need to restart the SQL Services to make it work.

No Comments