Conversation That Dont End.
Oct 16, 2006
Hi There
Message ordering is of utmost importance in our application.
As i found in testing the only way to ensure message ordering is if they are in the same conversation.If you send multiple messages in different conversations there is no garantee which will be processed first.
Therefore i will be creating conversations that last "forever", that is using a single conversation.
I plan on doing a BEGIN DIALOG CONVERSATION when an inititator site is setup and writing the conversation handle guid to a table.
I will them simply SEND ON SONVERSATION using the guid, i will never issue a end conversation from target or initiator.
Is this theory solid, ie: is there a better way or best practice to do this?
I know that conversatons persist with sql server restarts, however what happens if an initiator site db is restored ?
I was thinking of adding logic to first check if a conversation endpoint exists with the specified guid if not , then start another conversation. But is this the best way?
Thanx
View 2 Replies
ADVERTISEMENT
Dec 3, 2007
Hi
I'm using service broker and keep getting errors in the log even though everythig is working as expected
SQL Server 2005
Two databases
Two end points - 1 in each database
Two stored procedures:
SP1 is activated when a message enters the sending queue. it insert a new row in a table
SP2 is activated when a response is sent from the receiving queue. it cleans up the sending queue.
I have a table with an update trigger
In that trigger, if the updted row meets a certain condition a dialogue is created and a message is sent to the sending queue.
I know that SP1 and SP2 are behaving properly because i get the expected result.
Sp1 is inserteding the expected data in the table
SP2 is cleaning up the sending queue.
In the Sql Server log however i'm getting errors on both of the stored procs.
error #1
The activated proc <SP 1 Name> running on queue Applications.dbo.ffreceiverQueue output the following: 'The conversation handle is missing. Specify a conversation handle.'
error #2
The activated proc <SP 2 Name> running on queue ADAPT_APP.dbo.ffsenderQueue output the following: 'The conversation handle is missing. Specify a conversation handle.'
I would appreceiate anybody's help into why i'm getting this. have i set up the stored procs in correctly?
i can provide code of the stored procs if that helps.
thanks.
View 10 Replies
View Related
Apr 19, 2006
Hi:
My service broker was working perfectly fine earlier. As I was testing...I recreated the whole service broker once again.
Now I am able to get the message at the server end from intiator. When trying to send message from my server to the intiator it gives this error in sql profiler.
broker:message undeliverable: This message could not be delivered because the Conversation ID cannot be associated with an active conversation. The message origin is: 'Transport'.
broker:message undeliverable This message could not be delivered because the 'receive sequenced message' action cannot be performed in the 'ERROR' state.
How do I proceed now ?
Thanks,
Pramod
View 14 Replies
View Related
Jan 18, 2008
We have implemented our service broker architecture using conversation handle reuse per MS/Remus's recommendations. We have all of the sudden started receiving the conversation handle not found errors in the sql log every hour or so (which makes perfect sense considering the dialog timer is set for 1 hour). My question is...is this expected behavior when you have employed conversation recycling? Should you expect to see these messages pop up every hour, but the logic in the queuing proc says to retry after deleting from your conversation handle table so the messages is enqueued as expected?
Second question...i think i know why we were not receiving these errors before and wanted to confirm this theory as well. In the queuing proc I was not initializing the variable @Counter to 0 so when it came down to the retry logic it could not add 1 to null so was never entering that part of the code...I am guessing with this set up it would actually output the error to the application calling the queueing proc and NOT into the SQL error logs...is this a correct assumption?
I have attached an example of one of the queuing procs below:
Code Block
DECLARE @conversationHandle UNIQUEIDENTIFIER,
@err int,
@counter int,
@DialogTimeOut int,
@Message nvarchar(max),
@SendType int,
@ConversationID uniqueidentifier
select @Counter = 0 -- THIS PART VERY IMPORTANT LOL :)
select @DialogTimeOut = Value
from dbo.tConfiguration with (nolock)
where keyvalue = 'ConversationEndpoints' and subvalue = 'DeleteAfterSec'
WHILE (1=1)
BEGIN
-- Lookup the current SPIDs handle
SELECT @conversationHandle = [handle] FROM tConversationSPID with (nolock)
WHERE spid = @@SPID and messagetype = 'TestQueueMsg';
IF @conversationHandle IS NULL
BEGIN
BEGIN DIALOG CONVERSATION @conversationHandle
FROM SERVICE [InitiatorQueue_SER]
TO SERVICE 'ReceiveTestQueue_SER'
ON CONTRACT [TestQueueMsg_CON]
WITH ENCRYPTION = OFF;
BEGIN CONVERSATION TIMER ( @conversationHandle )
TIMEOUT = @DialogTimeOut
-- insert the conversation in the association table
INSERT INTO tConversationSPID
([spid], MessageType,[handle])
VALUES
(@@SPID, 'TestQueueMsg', @conversationHandle);
SEND ON CONVERSATION @conversationHandle
MESSAGE TYPE [TestQueueMsg] (@Message)
END
ELSE IF @conversationHandle IS NOT NULL
BEGIN
SEND ON CONVERSATION @conversationHandle
MESSAGE TYPE [TestQueueMsg] (@Message)
END
SELECT @err = @@ERROR;
-- if succeeded, exit the loop now
IF (@err = 0)
BREAK;
SELECT @counter = @counter + 1;
IF @counter > 10
BEGIN
-- Refer to http://msdn2.microsoft.com/en-us/library/ms164086.aspx for severity levels
EXEC spLogMessageQueue 20002, 8, 'Failed to SEND on a conversation for more than 10 times. Error %i.'
BREAK;
END
-- We tried on the said conversation, but failed
-- remove the record from the association table, then
-- let the loop try again
DELETE FROM tConversationSPID
WHERE [spid] = @@SPID;
SELECT @conversationHandle = NULL;
END;
View 2 Replies
View Related
Oct 2, 2007
update [order]
set Status = 'Open'
from (select [order].OrderId from CRM_Order [order]
inner join crm_orderproduct Oproduct on Oproduct.OrderId=[order].OrderId
group By [order].OrderId
having count(Oproduct.OrderProductId)=0 )
I m trying to update the Order <Table> Field Status, where order products count is zero. The Select statement lonely working fine but in update statement getting error.
Msg 102, Level 15, State 1, Line 6
Incorrect syntax near ')'.
View 4 Replies
View Related
Jul 28, 2007
hi there, i have a invoice template that when printed has a box for the users address (which there always will be) and a box for their delivery address if they are having the items delivered. However sometimes they dont have things delivered and so the record in the delivery table does not exist. In this case it will throw an error, how can i avoid this. the code im using i have posted below string sql = "SELECT [del_address], [del_post_code], [del_date], [del_time] From tbl_del WHERE order_ID = " + intOrderID;
//This creates a sql command which executes the sql statement.SqlCommand sqlCmd = new SqlCommand(sql, myConn);
myConn.Open();SqlDataReader dr = sqlCmd.ExecuteReader();
//This reads the first result from the sqlReader
dr.Read();
try
{
//string strDel_Address = dr["del_address"].ToString();
if (Convert.ToString(dr["del_charge"].ToString()) != null)
{
//delivery items lblDelAddy.Text = dr["del_address"].ToString();
lblDelPCode.Text = dr["del_post_code"].ToString();
View 3 Replies
View Related
Jul 18, 2007
Hi All,Just wondered if i could ask you for some advice and help.I'm looking to write a site, and one of the functions of the site is to remind the user of a certain event at a certain time. I was wondering how i would do this? or if anyone has a working example i could use?Also I dont quite know what database to use...... would MySQL do the function i am after???? If so then no more problem lol If not what database would you recommend i use?ThanksDanny
View 4 Replies
View Related
Aug 10, 2006
Hi all, can anyone explain to me why i am getting this error:
Cannot insert the value NULL into column 'WORKPATTERN_END', table 'MockDownload_V52.dbo.EMPLOYEE_WORKPATTERN'; column does not allow nulls. INSERT fails.
The code i am using is:
DELETE EMPLOYEE_WORKPATTERN
INSERT INTO EMPLOYEE_WORKPATTERN(
EMPLOY_REF)
SELECT CAST(EMPLOY_REF AS VARCHAR(10))
FROM EMPLOYEE
View 10 Replies
View Related
Nov 14, 2006
Hi Friends,
is it possible to find a table in which database it is?
ex: i have one table name rider. i've created it in one database, but i dont know in which database it is.but i know the server name.
is it possible to find like this?
thank you very much.
Vinod
View 9 Replies
View Related
Nov 7, 2007
Hi.I have a update query:
UPDATE test1
SET testprice= ((unitprice*8)/100) + unitprice
it's good.but I dont want to change the testprice if the unitprice is NULL.what should I do?
View 2 Replies
View Related
Dec 10, 2007
Hi!
I've one table named mytable. I dont want to drop and delete
this table? How can i achieve this ?
Please help me out!
Thanks!
View 9 Replies
View Related
Jul 5, 2007
Hi
I have a very smal question that im doing with the query builder in visual studio .net 2005.
there i have this sql question
SELECT tblObjekt.ObjektArkivID, tblObjekt.KundID, tblObjekt.KundensArkivNummer, tblObjekt.HuvudTitel, tbl_Spar.SparID
FROM tblObjekt INNER JOIN
tbl_Spar ON tblObjekt.ObjektArkivID = tbl_Spar.ObjektArkivID.
The problem i have is that it only finds 9 of 11 rows in the database. I thought that maybe some field were "null" but every field has some text in it.
The query must work since it finds 9 items, but 2 are missing.
Someone that knows what can be wrong?
Best regards / Mitmit
View 2 Replies
View Related
Jan 2, 2008
Hi.
I have a table with Login and Logoff Time of users, but there could be duplicate Logtimes in the dataset, but for
different products. Because of this I cant do a distinct in the dataset. I need the Product and some other details in my Report.
I tried to make two datasets. One for the Select distinct and one for the other.
But the Problem is:
in my report, I need a table, where I make the Sum of the Logintime a day and in another column I calculate with data from the other dataset.(Logtime + data from dataset2). But this doesnt work, so I think, that is it not possible to join 2 dataset in one table.
datetime Login | datetime Logout | Product
11.12.2007 10:15 | 11.12.2007 12:15 | p1
11.12.2007 10:15 | 11.12.2007 12:15 | p2
11.12.2007 12:19 | 11.12.2007 15:15 | p2
Is there another option I can do this?
View 4 Replies
View Related
Apr 25, 2008
i have 2 server, Database Server and Application Server.
i create a stored prosedure in Database SERVER (sql 2005)
i call this stored prosedure from my application but , my application dont see my stored prosedure..
what is a problem ? this is working my local computer and database.
my stored prosedure : sp_MyStoredProsedure
application :
...........Using myConnection As New SqlConnection(Config.ConnectionString)Dim myCommand As SqlCommand = New SqlCommand("sp_MyStoredProsedure", myConnection)
myCommand.CommandType = CommandType.StoredProcedure
......
i think Ado.net permission problem but i dont know what is problem
thx.
View 6 Replies
View Related
May 12, 2006
t1
item
partner
t2
item
partner
fname
store
i like select item and partern from t1 that dont exist in t2
View 1 Replies
View Related
Nov 10, 2007
Hello All Prg's
I need your help,
I use Database SQL server Express with C#
when I entred some data into DB by clciking on the table in server Explorer in Visual Studio 2005 IDE,
and then I make SQL in the code
as:
if (e.KeyCode == Keys.Return)
{
bool res;
int OldPlayerId = 0;
string ConnectionStr = Program.Member_Connect;
string sqlQuery = "select Player_ID from Player where Player_Code = '" + textBox1.Text + "'";
SqlConnection Sql_connection = new SqlConnection(ConnectionStr);
Sql_connection.Open();
SqlCommand command = new SqlCommand(sqlQuery, Sql_connection);
SqlDataReader dataReader = command.ExecuteReader();
if (dataReader.HasRows)
{
if (dataReader.Read())
OldPlayerId = dataReader.GetInt32(0);
else
MessageBox.Show("rtet");
}
else
{
res = false;
}
comboBox2.SelectedValue = textBox1.Text;
command.Dispose();
Sql_connection.Close();
Sql_connection.Dispose();
comboBox1.SelectedValue = OldPlayerId;
}
it work correctly on the old data that I entred them manualy, but when I enter new data from my project, this query don't give correct value, it still work correctly on old data,
I tried to take same data by combobox connected to view that contain same sql ,it work always.
but I need manualy Sql.
Please help me , I am very lating to delever my project...
please help me
thank you very mush
View 13 Replies
View Related
Jul 23, 2005
Im trying to recover my database using the mdf and ldf files.I dont have any backup and i have recovered two of the mdf files usinga tool which "discovers" deleted files after hard drive formatting...It sounds cool, isnt it...:? :(Obviously, i get a "suspect" message when the server starts and the logfile says this kind of things:·"Full PathName.MDF is not a primary database file." (This is one ofthe files repaired using the magic tool.·Error: 823, Severity: 24, State: 6·"I/O error (torn page) detected during read at offset0000000000000000 in file 'Full PathiName2.mdf'... Name2.mdf is thesecond file·Device activation error. The physical file name 'Full PathName2.mdf'may be incorrect.When i try to execute the command "DBCC CHECKDB ('Database_Name') WITHPHYSICAL_ONLY" i get the following message :·Could not open FCB for invalid file ID 0 in database 'Logs'.Do you have any ideas? Thank you very much...:D
View 2 Replies
View Related
Apr 20, 2007
I m using sql server 2005
i have got one request ,to apply page level locking on database
can nyone how it is done
i can do that for a single script and for session(transaction isolation level)
but dont know about database level locking scheme
thanks in advance
View 2 Replies
View Related
Sep 15, 2005
I do weekly full backups of my SQL databases via a scheduled T-SQL job.I noticed that I have some static databases that dont normally change,so I dont want to back it up if it has not changed, but when it does,then I want a backup.Is there something in the master table, as example, that I can checkprior to running the backup that will indicate any changes?An example is the Northwind database. I could exclude it from thebackup, but then I would not back it up if it where to change. Againthis is an example, I would not need to modify Northwind.Thanks in advance for any ideas; they usually give me ideas to problemsyet to come....Rob Camarda
View 3 Replies
View Related
Feb 6, 2003
Hi,
Im having a couple of problems with SQL.
I have this query...
SELECT Band.Name, Member.Name
FROM Member
JOIN MemberOf ON Member.Mid = MemberOf.Mid
JOIN Band On MemberOf.Bid = Band.Bid
WHERE MemberOf.Instrument = 'keyboards';
which basically shows me the name of the bands who had keyboard players. I would like it to also display the names of the band who didnt have keyboard players, replacing the keyboard players name with "NULL".
so... my questions are :)
how do u get it to display the records that do not match the condition, and how do u get it to replace the keyboard players name with "NULL" when they do not match the condition.
PS. The three tables are
Band. Which has Bid as a primary key.
Member. Which has Mid as a primary key.
MemberOf. Which links these through its two foreign keys Mid and Bid.
Thanks for your help! (assuming someone does)
View 2 Replies
View Related
Apr 5, 2008
I have a stored procedure in which at the bottom of the code, im granting execute permissions to a role I have defined. However, when I view the permissions on the procedure, the role isnt there, what could I be missing ? The procedures were all created under the default or dbo schema. I could manually give the permissions to the role, but id rather have it scripted.
help ?
View 5 Replies
View Related
Jul 20, 2005
I am doing a complete backup on a sql 7 db and then doing a completerestore (with overwrite existing db) on a sql 2000 server. This is nowour hot standby server. I have the process automated and it worksgreat. The only problem I have now is the logins dont work.I have tried running EXEC sp_change_users_login 'Report', and thelogins appear.However, when I run EXEC sp_helplogins 'joe', the results are empty.So, I am guessing all I need is a sp that will re-associate my loginswith the correct db and grant the appropriate permissions.If anyone has any ideas that would be great.I have also considered doing a log ship instead of a full backup andrestore. Does anyone have any suggections or good examples of how tomake that happen?Thanx
View 1 Replies
View Related
May 7, 2008
hi folks
I€™ve had a SQL 2000 server restored (using Veritas 9.1) to another server also running SQL 2000. I now have a collation problem.
When trying to add users to a database, I receive a "Error 446: Cannot resolve collation conflict for equal to operation" message.
I noted that tempdb and user tables collation don€™t match - so I was going to change the user tables. However, the master collation doesnt match tempdb, model or msdb.
Server is set to SQL_Latin1_General_CP1_CI_AS
Master - SQL_Latin1_General_CP1_CI_AS
tempdb, model, msdb - Latin1_General_CI_AS
I was under the impression that when tempdb was recreated it inherited the master database's collation? This doesn€™t seem to be happening.
any ideas?
much appreciated
N.
View 7 Replies
View Related
Jan 30, 2008
I have an excel file source, that has a column that is a date column, although the group puts in more that just a date sometimes: example (11/1/2007) or (Sold), the problem is I cant get SSIS to ever see anything but the date, for the cells that have Sold shows me null, or blank when doing a view. Any thoughts??? I am starting to hate excel more and more.
View 4 Replies
View Related
Jul 29, 2007
I have installed SQL 2005 Standard Edition on my Window XP many times and I dont see Server Management Studio.
Did I do something wrong?
Thanks.
View 8 Replies
View Related
Jul 7, 2006
To configure database mirroring
After connecting to the principal server instance, in Object Explorer, click the server name to expand the server tree.
Expand Databases, and select the database to be mirrored.
Right-click the database, select Tasks, and then click Mirror. This opens the Mirroring page of the Database Properties dialog box.
To begin configuring mirroring, click the Configure Security button to launch the Configure Database Mirroring Security Wizard.
but i do not see any "Mirror" Option in the "Tasks" menu.
Why ?
View 1 Replies
View Related
Jan 8, 2008
I dont find sql management express in the program folder of sql server 2005. i find configuration manager but dont find the sql server management express. If the program is deleted also then the shortcut is deleted but not the whole program.
i can find the files in the respective folders of program files -> microsoft sql server 2005. but dont know which files start
the sql managment express
View 1 Replies
View Related
Sep 12, 2007
Hi all,
i'm trying to create a publication and its snapshot in the default snapshot folder of MS SQL Server 2005.
It's all done by RMO.
Following Scenario:
1. PublicationDB was created by User1(sysadmin) ... successful
2. Enable PublicationDB for Publishing ... successful
2. Creating the publication: executed as User2(db_owner)
2.1 publication.Create(); ... successful
2.2 publication.CreateSnapshotAgent(); ... successful
2.3 Add Articles to publication ... successful
2.4 Generate Snapshot with
agent = new SnapshotGenerationAgent(); and setting all parameters for it, then execute by
agent.GenerateSnapshot();
And at this point,i got an error message, because the snapshot agent cant be executed ...
2007-09-12 12:05:46.58 User-specified agent parameter values:2007-09-12 12:05:46.58 --------------------------------------2007-09-12 12:05:46.60 -Publisher EDOM04SQLstandard2007-09-12 12:05:46.60 -PublisherDB TMS4X_PublicationDB2007-09-12 12:05:46.60 -Publication TMS4X_PublicationTest2007-09-12 12:05:46.60 -ReplicationType 22007-09-12 12:05:46.60 -Distributor EDOM04SQLstandard2007-09-12 12:05:46.60 -DistributorSecurityMode 12007-09-12 12:05:46.60 -PublisherSecurityMode 12007-09-12 12:05:46.60 --------------------------------------2007-09-12 12:05:46.63 Connecting to Distributor 'EDOM04SQLstandard'2007-09-12 12:05:46.96 The replication agent had encountered an exception.2007-09-12 12:05:46.96 Source: Replication2007-09-12 12:05:46.96 Exception Type: Microsoft.SqlServer.Replication.ReplicationAgentSqlException2007-09-12 12:05:46.96 Exception Message: You do not have sufficient permission to run this command. Contact your system administrator.2007-09-12 12:05:46.96 Message Code: 142602007-09-12 12:05:46.96
Configurations:
-All Users have rights for read and write on the snapshotfolder including the Agent
-All users are defined in the same windows domain
-the snapshotagent account has sysadmin rights on the server and is assigned to the predefined MS SQL User Role
This scenario is workin completely fine when i exceute everything as a "sysadmin"!
But when executing it all as "db_owner" of the database, its not workin!!!
Does anybody has any resolutions for this problem?
I appreciate any support.
MariJo
View 6 Replies
View Related
Sep 14, 2007
I explicitly set one column to have text qualifiers in a flat file connection mgr and specified to use double quotes as the qualifier, yet in the output file, the column is not qualified. What did I leave out ?
View 2 Replies
View Related
Dec 17, 2007
when shipping data from one place to another, without complicated merge needs, do service broker and replication differ in what they offer?
View 4 Replies
View Related
Sep 25, 2006
I have a system that will post a message to a queue, but does not need to wait for a response - just needs to make sure the message arrived properly in the queue, not that is was processed at the receiving end. A second service will poll the queue to retrieve outstanding messages and will then move the message to an outside system. The movement of the message to the outside system will be wrapped in a transaction and if the process is successful, then the transaction will be commited otherwise it will be rolled back.
1) is it appropriate for the service that posts the message to send an END CONVERSATION ? This way the sending service will not be waiting for a response.
2) in the data movement phase, is it appropriate to issue and END CONVERSATION when commiting and not issue when ROLLBACK occurs. Or should ROLLBACK occur with a following END CONVERSATION with error message?
View 7 Replies
View Related
Jul 30, 2006
I am attempting to learn Service Broker from Bob Beauchemin's book "A Developer's Guide to SQL Server" - Chapter 11. I'm finding it to be very good but I'm confused over the concept of closing a conversation. Could someone answer the following questions for me?
When a conversation is ended, can the conversation handle that was created when the conversation was created still be used? (I assume not)
Beauchemin says, on page 511, that when a conversation ends, "Any messages still in the queue from the other end of the conversation are deleted with no warning." Does this mean that if I send a message that expects a reply, but I end the conversation, the message is still sent, it is still received by the other endpoint, the other endpoint processes it, but I'll never receive the reply?
Beauchemin says that if no lifetime is specified, the conversation is active for the number of seconds which can be represented by the maximum size of an integer. Does this mean that if I don't specify a lifetime, a conversation is active for many, many years?
Thanks very much.
Amos
View 1 Replies
View Related
Sep 6, 2007
I want to reuse conversations to minimize overhead during bursts of activity. Remus' article on reusing conversations (http://blogs.msdn.com/remusrusanu/archive/2007/05/02/recycling-conversations.aspx) is great. (I know you are reading this Remus, thanks.)
I was wondering if there is a simpler way of ending a cached conversation - Quiesce the conversation (Stop using it), then after some period of time, end it.
I create a conversation, cache it in RLY_Conversations, and use it for 50 seconds. After 1 minute, the dialog timer servicing proc ends the conversation. There will be no messages sent around the time the End Conversation takes place, thus no race conditions.
Do you see any problems with this method?
Select @DialogHandle = [conversation_handle]
From RLY_Conversations
Where TableName = @TableName and IsActive = 1 And
CreatedTmstp > dateadd(ss, -50, getdate())
if @DialogHandle is null
Begin
-- initialize a conversation and record it in our reuse table
BEGIN DIALOG CONVERSATION @DialogHandle
FROM SERVICE FirstHostRelayService
TO SERVICE 'SecondHostRelayService'
ON CONTRACT RelayContractSentByAny
WITH ENCRYPTION=OFF ;
-- cache the dialog handle to minimize dialog creation overhead.
Insert into RLY_Conversations (
TableName, conversation_handle, conversation_id, is_initiator, service_contract_id,
conversation_group_id, service_id, lifetime, state, state_desc, IsActive, CreatedBy, CreatedTmstp
)
Select @TableName, conversation_handle, conversation_id, is_initiator, service_contract_id,
conversation_group_id, service_id, lifetime, state, state_desc, 1, 'Setup', getdate()
From sys.conversation_endpoints
Where conversation_handle = @DialogHandle;
-- initiate housekeeping process
BEGIN CONVERSATION TIMER ( @DialogHandle )
TIMEOUT = 60;
End
View 1 Replies
View Related