The SQL Server Service Broker for the current database is not enabled -when using SqlCacheDependency

I was in the process of using SqlSiteMapProvider class today by jeff which is a new feature of ASP.NET 2.0 and i have always wanted to try this out
My main goal is to have a database driven site navigation interface with a securitytrimming feature which i know is possible

But after running the sql script to insert some sample tables to the DB and setting upt the project in VS 2005.
Ran F5 to run a sample page  and bingo error:

The SQL Server Service Broker for the current database is not enabled

After doing some search i saw a post that said you just have to run the below from query analyzer:

ALTER DATABASE DatabaseName SET ENABLE_BROKER;

But the query kept running for minutes and never stopped.So i taught there must be some conflicts.
So i started looking for a way to force the close off conflicting sessions.

So i ran
ALTER DATABASE DatabaseName SET NEW_BROKER WITH ROLLBACK IMMEDIATE;
and then
ALTER DATABASE Databasename SET ENABLE_BROKER;

and then the query ran successfully

make sure you run:

SELECT is_broker_enabled FROM sys.databases WHERE name = 'DatabaseName'

to get the correct value : is_broker_enabled = 1

Hope that helps

 

posted @ Wednesday, October 15, 2008 6:18 PM

Print

Comments on this entry:

# re: The SQL Server Service Broker for the current database is not enabled -when using SqlCacheDependency

Left by Paul at 4/24/2009 7:14 AM
Gravatar
Thanks a lot for posting the solution, saved me a lot of time!

# re: The SQL Server Service Broker for the current database is not enabled -when using SqlCacheDependency

Left by Nelly at 6/10/2009 3:44 PM
Gravatar
Thank you!

# re: The SQL Server Service Broker for the current database is not enabled -when using SqlCacheDependency

Left by DotNetGuts at 8/14/2009 6:34 AM
Gravatar
You are awesome.

That was really helpful.

Many Thanks.

# re: The SQL Server Service Broker for the current database is not enabled -when using SqlCacheDependency

Left by Jason Frain at 11/12/2009 1:00 PM
Gravatar
Thank you very much. Its very kind of you to share this information.

Your comment:



 (will not be displayed)


 
 
 
 

Live Comment Preview:

 
«November»
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345