Showing posts with label quotselect. Show all posts
Showing posts with label quotselect. Show all posts

Tuesday, March 20, 2012

conversation_handle in Queue doesn't match "SEND ON CONVERSATION..." value.

When examining the "conversation_handle" column value in the Queue (from: "select * from ProcessQueue"), I find the value of the conversation_handle appears to be different from the "conversation handle" ("SEND ON CONVERSATION @.conversationHandle...") on which the message was sent.

I'm trying to gather all messages for a given Dialog conversation, but am not able to do this because the conversation_handle doesn't appear consistent between messages in the Dialog.

note: the conversation_handle of "BEGIN CONVERSATION TIMER (@.conversationHandle)..." message does appear to be correct in the Queue.

Thoughts on why the conversation_handle listed in the Queue might be different than that of the
"SEND ON CONVERSATION @.conversationHandle..." command that sends the message?

-
-
-


ALTER PROCEDURE [dbo].[SendMessageStoredProcedure]
AS

-- Declare Conversation Handle
DECLARE @.conversationHandle uniqueidentifier;

-- Declare Message
DECLARE @.message nvarchar(max);

-- Begin Transaction
BEGIN TRANSACTION;

-- Begin Dialog from Service1 to Service2 on Contract
BEGIN DIALOG @.conversationHandle
FROM SERVICE ExecuteProcess
TO SERVICE 'ExecuteProcess'
ON CONTRACT Process;


FROM DEBUGGER: @.conversationHandle has value of AC8DF4E0-9F38-DB11-96A2-000CF1D46448

-- Set Message value
DECLARE @.requestDocument xml
SET @.requestDocument = N'<ProcessRequestMessage/>';

-- Start Converstation time
BEGIN CONVERSATION TIMER (@.conversationHandle) TIMEOUT = @.queueSeconds;

-- Send Message
SEND ON CONVERSATION @.conversationHandle MESSAGE TYPE ProcessRequest (@.requestDocument);

-- Commit Transaction
COMMIT TRANSACTION;

-
-
-

RESULTS OF: select * from ProcessQueue;

status priorty q_order conversation_group_id conversation_handle msg_s_# service_name ser_id srv_cont_name ...
1 0 1 AD8DF4E0-9F38-DB11-96A2-000CF1D46448 AC8DF4E0-9F38-DB11-96A2-000CF1D46448 -2 ExecuteProcess 65536 Process 65536 http://schemas.microsoft.com/SQL/ServiceBroker/DialogTimer 5 E NULL
1 0 0 AE8DF4E0-9F38-DB11-96A2-000CF1D46448 AF8DF4E0-9F38-DB11-96A2-000CF1D46448 0 ExecuteProcess 65536 Process 65536 ProcessRequest 65536 X 0xFFFE3C004400610074006100620...

Conversation handles uniquely identify a conversation endpoint. Since a dialog has two endpoints (the initiator and the target), it will have two conversation handles. The handle returned by the BEGIN DIALOG statement is the conversation handle at the initiator whereas the one in the target queue is the handle for the target endpoint of the dialog.

Conversation IDs, on the other hand, uniquely identify a conversation. Hence for a dialog, you will notice that the conversation ID is the same at the initiator and the target.

You can see converstaion_handle, conversation_id and other properties of your conversation endpoints by looking at the sys.conversation_endpoints view.

|||Thanks! ...exactly the clarification I needed.

conversation_handle in Queue doesn't match "SEND ON CONVERSATION..." value.

When examining the "conversation_handle" column value in the Queue (from: "select * from ProcessQueue"), I find the value of the conversation_handle appears to be different from the "conversation handle" ("SEND ON CONVERSATION @.conversationHandle...") on which the message was sent.

I'm trying to gather all messages for a given Dialog conversation, but am not able to do this because the conversation_handle doesn't appear consistent between messages in the Dialog.

note: the conversation_handle of "BEGIN CONVERSATION TIMER (@.conversationHandle)..." message does appear to be correct in the Queue.

Thoughts on why the conversation_handle listed in the Queue might be different than that of the
"SEND ON CONVERSATION @.conversationHandle..." command that sends the message?

-
-
-


ALTER PROCEDURE [dbo].[SendMessageStoredProcedure]
AS

-- Declare Conversation Handle
DECLARE @.conversationHandle uniqueidentifier;

-- Declare Message
DECLARE @.message nvarchar(max);

-- Begin Transaction
BEGIN TRANSACTION;

-- Begin Dialog from Service1 to Service2 on Contract
BEGIN DIALOG @.conversationHandle
FROM SERVICE ExecuteProcess
TO SERVICE 'ExecuteProcess'
ON CONTRACT Process;


FROM DEBUGGER: @.conversationHandle has value of AC8DF4E0-9F38-DB11-96A2-000CF1D46448

-- Set Message value
DECLARE @.requestDocument xml
SET @.requestDocument = N'<ProcessRequestMessage/>';

-- Start Converstation time
BEGIN CONVERSATION TIMER (@.conversationHandle) TIMEOUT = @.queueSeconds;

-- Send Message
SEND ON CONVERSATION @.conversationHandle MESSAGE TYPE ProcessRequest (@.requestDocument);

-- Commit Transaction
COMMIT TRANSACTION;

-
-
-

RESULTS OF: select * from ProcessQueue;

status priorty q_order conversation_group_id conversation_handle msg_s_# service_name ser_id srv_cont_name ...
1 0 1 AD8DF4E0-9F38-DB11-96A2-000CF1D46448 AC8DF4E0-9F38-DB11-96A2-000CF1D46448 -2 ExecuteProcess 65536 Process 65536 http://schemas.microsoft.com/SQL/ServiceBroker/DialogTimer 5 E NULL
1 0 0 AE8DF4E0-9F38-DB11-96A2-000CF1D46448 AF8DF4E0-9F38-DB11-96A2-000CF1D46448 0 ExecuteProcess 65536 Process 65536 ProcessRequest 65536 X 0xFFFE3C004400610074006100620...

Conversation handles uniquely identify a conversation endpoint. Since a dialog has two endpoints (the initiator and the target), it will have two conversation handles. The handle returned by the BEGIN DIALOG statement is the conversation handle at the initiator whereas the one in the target queue is the handle for the target endpoint of the dialog.

Conversation IDs, on the other hand, uniquely identify a conversation. Hence for a dialog, you will notice that the conversation ID is the same at the initiator and the target.

You can see converstaion_handle, conversation_id and other properties of your conversation endpoints by looking at the sys.conversation_endpoints view.

|||Thanks! ...exactly the clarification I needed.

Friday, February 24, 2012

CONTAINS in Full Text Searching

Hi

I've used CONTAINS on a varchar field.

in SQL SERVER 2000

the query was "Select name from description where CONTAINS(name,' "donot*" ')

say if I search for "Select name from description where CONTAINS(name,' "donot a*" ')

it doesn't return rows.

as might be it is seeing that 'a' as the starting letter of AND key word which is used in CONTAINS

but how to tell that it is my next letter in the search

Really I need more clarity on this...

Thanxs in advance

Could you explain what results you would expect to achieve from both queries?

Also, can you confirm that you are running both queries on SQL2k?

|||

And is only recognized by SQL Server if you specify it as a whole word (AND). A* Assumes a word with the first letter A.

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

I'm using SQL Server 2000

say my list consists of "donot alter" word...I'm not getting that row in my output.

|||Which wordbreaker are you using ?

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

I just used this query

Select name from description where CONTAINS(name,' "donot a*" ')

on the description table with full-text searching on Name field.

CONTAINS in Full Text Searching

Hi

I've used CONTAINS on a varchar field.

in SQL SERVER 2000

the query was "Select name from description where CONTAINS(name,' "donot*" ')

say if I search for "Select name from description where CONTAINS(name,' "donot a*" ')

it doesn't return rows.

as might be it is seeing that 'a' as the starting letter of AND key word which is used in CONTAINS

but how to tell that it is my next letter in the search

Really I need more clarity on this...

Thanxs in advance

Could you explain what results you would expect to achieve from both queries?

Also, can you confirm that you are running both queries on SQL2k?

|||

And is only recognized by SQL Server if you specify it as a whole word (AND). A* Assumes a word with the first letter A.

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

I'm using SQL Server 2000

say my list consists of "donot alter" word...I'm not getting that row in my output.

|||Which wordbreaker are you using ?

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

I just used this query

Select name from description where CONTAINS(name,' "donot a*" ')

on the description table with full-text searching on Name field.

CONTAINS in Full Text Searching

Hi

I've used CONTAINS on a varchar field.

in SQL SERVER 2000

the query was "Select name from description where CONTAINS(name,' "donot*" ')

say if I search for "Select name from description where CONTAINS(name,' "donot a*" ')

it doesn't return rows.

as might be it is seeing that 'a' as the starting letter of AND key word which is used in CONTAINS

but how to tell that it is my next letter in the search

Really I need more clarity on this...

Thanxs in advance

Could you explain what results you would expect to achieve from both queries?

Also, can you confirm that you are running both queries on SQL2k?

|||

And is only recognized by SQL Server if you specify it as a whole word (AND). A* Assumes a word with the first letter A.

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

I'm using SQL Server 2000

say my list consists of "donot alter" word...I'm not getting that row in my output.

|||Which wordbreaker are you using ?

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

I just used this query

Select name from description where CONTAINS(name,' "donot a*" ')

on the description table with full-text searching on Name field.