Hi,
Im looking for explanation of the scenario with dialog lifetime set. I have two sevices server and client - working in the same database on SQL 2008 Express. Client opens conversation with lifetime set and sends a message. On the server service side the message is received and replied - messages reach receivers. Then after some time the lifetime for conversation expires and both sides get error message. Both sides end conversation then.
And in sys.conversation_endpoints record for the service side of conversation remains with the state CLOSED. It is not purged from there (I know about 30 mins delay - but it sits there for hours, or days).The record for the client side disappears after client ends conversation.
I have read some posts and blogs on the service broker, the scenario is similar to most simple scenarios found there (including the one from the book on T-SQL programming for SQL 2005) except that conversation always ends with lifetime expiration.I think that this is not 'fire and forget' scenario (is it?).
Both sides execute this to end the conversation:
if @RecvReqMsgName = N'http://schemas.microsoft.com/SQL/ServiceBroker/EndDialog'beginEND CONVERSATION @RecvReqDlgHandle;break;end;if @RecvReqMsgName = 'http://schemas.microsoft.com/SQL/ServiceBroker/Error'beginEND CONVERSATION @RecvReqDlgHandle;break;end;
Does anybody know why the server(target) conversation record remains forever?
There are also no messages left in client, server or transmision queue. Records have proper seecurity_timestamp value about 30 minutes ahead of the lifetime. What is interesting end_dialog_sequence is -1 in sys.conversation_endpoints.
Looks like server side has not received end dialog message or ack - is it becouse of lifetime error message ?
Is presence of error message prevent from receiving reply for end conversation - then why client side terminates properly (some race condition)?
Regards