Sunday, February 26, 2012

Getting HelloWorld_CLR sample to work

Hello,

I have been trying to get the app installed and running; I've updated the install script to point to the right server and it worked. I've run the

ALTER DATABASE ssb_HelloWorld SET ENABLE_BROKER; and the

EXEC sp_configure 'clr enabled', 1;

and the CLR seemed to have problems while getting replies back from the server. However after repeated retries it worked well. Sporadically I would see an error. After uninstalling the sample and installing it again - to document the steps previously taken - the CLR application is no longer receiving messages from the server. Any idea about what setting might be needed?

Thanks,

Running the app - after a while - just for kicks, it worked. I do not understand why? Any help greatly appreciated.|||

Could you please clarify what you mean by "works" and "not works". For example, when you say "does not work" do you mean:

a) target queue is not getting the messages (i.e. select * from TargetQueue has no messages)

b) activation procedure is not getting activated at all (i.e. you don't see any tasks activated in select * from sys.dm_broker_activated_tasks but select * from TargetQueue is non-empty)

c) activation procedure gets launched but is throwing unhandled exceptions (which are reported to eventlog).

Thanks,
Rushi

|||

Hi Rushi,

After successfully sending a message from HelloWorldClient to HelloWorldService, the client app attempts to get a conversation from the service. It is here that no conversation is returned.

Also, as I am learning about this SQL Server Service Broker, and reading the online documentation, would there be:

1. A good book that would comprehensively cover Service Broker and CLR

2. Additional HelloWorld_CLR sample documentation. This sample touches - for instance message looping - that I could not find explicit related documentation.

Thanks in advance

|||

Rushi,

here is more info, from the event application log. The problem seems to have come back:

An error occurred in the service broker message dispatcher, Error: 15404 State: 19.

|||

See this previous post: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=65711&SiteID=1

Typically, this problem occurs because the dbo account is mapped to an invalid Windows login. Random failures indicate that the login is randomly valid/invalid, like for instance when you work on a laptop and sometimes you're connected to the domain sometimes you're not. Changing dbo to a valid login (like [sa]) resolves the issue:

ALTER AUTHORIZATION ON DATABASE::[dbname] TO [SA];

HTH,
~ Remus

No comments:

Post a Comment