What is actually happening when a conversation timer is being used in terms of the dialog_timer column in sys.conversationendpoints? For example, I was using the following query to tell me which conversation timers are currently running:
SELECT * FROM sys.conversation_endpoints
WHERE dialog_timer > '1900-01-01 00:00:00.000'
However, I have noticed that periodically the dialog_timer value goes back to '1900-01-01 00:00:00.000' and the query fails, starting up another timer. Then, the original timer magically appears again, working just fine. So, I changed to this query:
SELECT * FROM sys.conversation_endpoints
WHERE far_service
IN
(
'TimerService1',
'TimerService2',
'TimerService3',
)
But this seems like the long way around and doesn't really indicate that the timer is running or not, just that its present in the sys.conversationendpoints catalog view. What is the proper way to see if timers are running? If one dies for some reason, I need to restart it.
Using conversation timers, I would like to send a message to myself. I could then use the self-addressed message to check on the availability of a provider. What would be the recommended approach for doing this using the ServiceBrokerInterface? It seems that I might need to add a method to the Service class. Is it correct? Thanks,
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.
Does anyone know how i can keep an ssis package used for real time reporting alive no matter the amount of errors it gets? So for instance the server im streaming to is shutdown for maintenance, and the connection dies, its needs to just keep re-trying. In other words the maximum error count is infinite. i dont just want to set max err count high, i want it out of the picture all together.
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.
Currently, our application is issuing a 'select count(*) from systypes' command to check to see if the database connection is live (has not been reaped by the firewall.) This is somewhat inefficient. Perhaps a less expensive way to implement this functionality is to issue a ping statement to the instance? At least a more simple SQL query is needed.
I'm sure this function is typical in application architecture. What recommendations do you have for confirming that a database connection is alive and viable from the application?
We are having some problems with the SQL Server 2005 Keep Alive mechanism causing dropped connections. The Keep Alive time and interval appear to work as documented. However the number of retries made before dropping the connection seems to be variable. When running Network Monitor I have seen this vary between 3 and 9 retries. The value for TcpMaxDataRetransmissions in the registry is set to 5. Does anyone know what the correct number of retries should be for SQL Server 2005 Keep Alive? Is this dynamically determined or is this a bug?
We tested this new feature ("Keep Alive" for orphant connections to automatically close) with no success - neither the standard properties nor slightly changed properties worked.
We tested like this: SQL Server 2005 - ADO.NET Client The client established an explicit lock on one row at one database. Afterwards we disconnected the client by pulling out the network-cable. We waited about 35 sec for the sessios to close - but nothing happend; we waited another minute but nothing changed. SQL Server Management Studio and the command line "netstat" told us that the connections are alive ... so what went wrong? Did we miss something?
Our goal is, that such "orphant connections" get cleaned up and also their inked locks on the database. BTW we installed the sp1 before all the tests started!
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;
There are 2 tables for transaction. The header and tail tables. How do I insert records. if one is updated & another is not ? the sequence for tracking the records will fail. How do I deadlock the table for insert especially when I use stored procedures for 'Inserts'.
I have 2 transactions, the first one has MANY updates to the table A and it finishes with a commit or rollback (ONLY AT THE END), the second one has only one insert into the table A that finishes with a commit or rollback, the problem is that the update process takes a long time to finish, and the insert process could be thrown during the first process, there's where I get everything locked cause the table A is locked and my java aplication gets stuck.
Note: When I execute each transaction independient I have no problems.
Is there any possibility to lock table A completly for the first transaction and release It for second one ??
Could you give me any suggestion of what to do step by step ?
It's been pretty quiet on here recently - no-one experiencing any corruption problems we haven't already given guidance on? Cool...
Paul Randal Lead Program Manager, Microsoft SQL Server Storage Engine + SQL Express (Legalese: This posting is provided "AS IS" with no warranties, and confers no rights.)
I have a Orders table, this has a Primary key on one Column ( OrderID )
We are using a Stored Proc to insert data into this table ( I am not starting the Transaction in the stored Proc ) as its controlled by the front end written in C++.
when ever there is a update on this Orders table I move the record to the ordershistory table. ( I have a trigger in the CTOrders table on INSERT and UPDATE )
The C++ App does an Async I/O. Offlate the App is experiencing a few dead locks during the day espicially at the market open and Close as this database is for the Trading System.
I have a SQL Server 2005 system that has been running for about 2 years. This morning nothing will connect. SQL Server Agent will not start. It gives me the message
"The request failed or the Service did not respond in a timely manner. Consult the event log or other applicable error logs."
The error log only states the SQL Server Agent cannot connect to server CANSPEC-TMMCSQLDEV and it is shutting down.
When i try to logon to SQL Server using Management Studio i get the following message:
"A connection was successfully established with the server, but then an error occured during the pre-logon handshake. Provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe. Microsoft SQL Server Error : 233"
The help for this error states that it could be caused by the fact that SQL Server does not allow remote connections. I have remote connections turned on.
Microsoft products that are doing well tend to have very strong communities around them, and I am starting to get a bit disappointed with SQL-CLR. This forum seems fairly light, the links int he FAQ are broken, and the official SQL-CLR blog has no update since 2006..
Taking all of that into account I am forced to wonder, Is this a dead subject?
I am not trying to say that the people in this forum are doing something wrong, nor am i claiming that no one uses SQL-CLR (i am a user, thats why im here). But I did want to get the opinion of the group here of where they think this concept stands.
I think SQL-CLR can really be a good tool in the chest for various scenarios. I am for one using it to have a generic SQL-CLR Stored Procedure that can analyze small sets of data and move it into various buckets depending on validation rules built into the code. So far its working very well, but I admit it has not yet hit production so only time will tell. (Performance is always a concern of mine)
Hi There, I was updating a Custome Error Log table in different Data Flow Task in a Package. Custom log table is being used to log the Redirect Rows which sent by a component if it has errors. So I am catching the error raised by componets and putting them all into one table. I thing this could be the cause for the following error. I am not sure Please help me out. What could be the cause of this error and how to prevent it?
SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft OLE DB Provider for SQL Server" Hresult: 0x80004005 Description: "Transaction (Process ID 71) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.".
HP Proliant DL385 G1, 142*6 GB AMD Opteron „¢ Processor 280, 2.40 GHz 4.00 GB RAM, DVD ROM Win2K3 R2, SP1 64bit
SQL Server Details:
SQL Server 2000 Enterprise Edition 32bit Service Pack4
Network Details:
Clients can access the server by Terminal Server and also by Direct Connectivity. The connectivity is provided by RF network Provider.
Application Details:
Application was designed by Power Builder 6.5.
Error Details: If I divide my clients connectivity to the server then it is divided into 3 types
TYPE A >> Users inside my LAN using a DNS server they give the server name in their Parameter file to connect to the Database Server.
TYPE B >> Users who are in WAN connect to the server by Terminal Servers for Data Input. Terminal Servers are inside my LAN.
TYPE C >> Users who are in WAN connect to the Server by Direct Connection for Reports and Print Out they give the IP address of the Database server directly in their Parameter files.
After every 6 to 7 days the ERROR DB Processes Dead comes to the TYPE C. The error Numbers are 100025 and 100005.
At the same time TYPE A AND TYPE B are not getting any errors.
For further diagnosis I have taken a client machine to Net Meeting and taken his desktop in control. I have connected the client machine to the database server by ISQL in command prompt.
From Backend I can see that the SQL server has allocated a SPID to the client machine. After I have executed
1>SELECT * FROM SYSDATABASES 2>GO
It will return me all data but it will not show me how many rows selected or EOF.
After some time it will give me the prompt (3>) but without EOF and after that if I give another query then it will give the below error
DB-Library: Attempt to initiate a new SQL Server Operation with results pending.
DB-Library: Unexpected EOF from SQL Server. General Network Error. Check Your Documentation. Net-Library error 10054: ConnectionCheckForData (CheckForData()) DB-Library: DBPROCESSES is dead or not enabled. DB-Library: DBPROCESSES is dead or not enabled. DB-Library: DBPROCESSES is dead or not enabled. DB-Library: DBPROCESSES is dead or not enabled.
At the same time if I give IP address of another server then it works and TYPE A and TYPE B don€™t get any problem.
To stop this error I have to restart the server after that for again seven days it works and again the same problem.
I cant find anything I have checked tempdb, cache size but it is normal no abnormal activities.
I am build an application based on different WCF services which colect different type of data from an SQL database. I can have up to 10 clients whcih could at a certain times collect the same data as a read or right operation. I have run a test where I have only 2 clients, and I have been surprise to receive a nice error of dead lock process.
The error is as follow :
Transaction (Process ID 63) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction."
In the store procedure which I am suspected, not sure yet, I have been advise to use the
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; but no help
According to what I could notice in my application, I have one process which insert rows in this table, while clients read the same table..but I guess dead lock need to investigate in a more better way and handle it anyway...
I am not a databse administrator so I have no idea how to handle such situation.
Please help me to remove deadlock. Server Error in '/' Application.
Transaction (Process ID 69) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Transaction (Process ID 69) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
Source Error:
Line 292: da.SelectCommand.Parameters.Add(HierCode3)Line 293: Dim ds As New DataSetLine 294: da.Fill(ds, "Employees")Line 295: Con.Close()Line 296: Dim dt As DataTable = ds.Tables("Employees")
I'm having a transactional replication which replicates data every 1min.... and i got a job which runs every 15mins and pulls the reports from source db which is being replicated.
Some times when the replication is pushing the data the same time the job is trying to generate reports and as the table is being locked at the time of replication the dead lock issue is rinsing and the job is getting failed.
We are running application on Ms SQL Server connecting to PowerBuilder 7.0.3, using MSS Microsoft SQL Server 6.X driver. We have recently migrated the SQL Server from 2000 to 2005 SP2, in which databases are still at compatability level 80. The application runs perfectly for one week, but later we received some occassional reports from users that database connection breaks after a
certain idle period. Below are the errors, usually error 1 appears before error 2.
Error 1 A database error has occured. Database error code: 10025 Database error message: Select error: Possible network error: Write to SQL Server Failed. General network error. Check your documentation.
Error 2 A database error has occured. Database error code: 10005 Database error message: Select error: DBPROCESS is dead or not enabled.
We couldn't find any related errors in the SQL Server log. Does anyone has the idea of what's wrong or how to trace the connection brokerage?
I set up a table, job and alert as described in this article on msdn: http://msdn2.microsoft.com/en-us/library/ms186385.aspx
The alert is working fine but the job is failing with the following info: Message Unable to start execution of step 1 (reason: Variable WMI(TextData) not found). The step failed.
The info does seem to be posted in the log which is not where I wanted it. Anyone have any ideas what I have not got set up correctly? I have the trace on and works since the info goes to the log, but I would like it in the database not in the log.
Any help would be appreciated. Thanks
Linda Leslie Academic Information Technology & Libraries University of Cincinnati