Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SqlTransaction problem after some time

See original GitHub issue

Good morning, we are using SqlTableDependency into an always running Windows Service like a “notifications centralized service”; after about two days of always running we get a sql transaction exception, i logged also the SqlTableDependency status change:

[21:02:33] Status changed: STOPDUETOERROR [21:02:33] Error message: TableDependency stopped working exception: System.InvalidOperationException: This SqlTransaction has completed; it is no longer usable. at System.Data.SqlClient.SqlTransaction.ZombieCheck() at System.Data.SqlClient.SqlTransaction.Rollback() at TableDependency.SqlClient.SqlTableDependency`1.<WaitForNotifications>d__63.MoveNext()

Is maybe a sql transaction timeout problem or something like that in the sql server configuration?

Thanks very much in advance

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

fluxiumcommented, Jul 5, 2019

Has anyone attempted to resolve this issue by having your application react to the SqlTableDependency OnError or OnStatusChanged events? I use a wrapper class over SqlTableDependency that has a Configure() method and a Start() method. Start() calls Configure(). The event handler for SqlTableDependency OnError events uses a Polly RetryPolicy to call the Start() method with exponential backoff until it returns without exceptions. I am accessing SQL Server instances over slow/intermittent/noisy links and this design works beautifully for us. The service is resilient without the need for external watch dog servicing.

sagunpandeycommented, Jul 11, 2019

@fluxium I am using an external service that reinitializes SqlTableDependency in a certain interval. This is very inefficient and we are having a lot of issues. Can you kindly share your solution?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting timeout errors with SqlTransaction on same table
I started with using but problem I encountered is I will open the connection for every line read. I am still thinking how...
Read more >
SqlTransaction in C# issue - Microsoft Q&A
I have a method which is storing values in database and after that it is print invoice. I'm printing a form for invoice...
Read more >
How To Handle 'No Longer Usable SqlTransaction' Error In ...
In this article, you will learn how to resolve the following error: “This SqlTransaction has completed; it is no longer usable”.
Read more >
Concurrency problems - theory and experimentation in ...
This phenomenon happens when two transactions access the same record and both updates this record. The following figure summarizes what could ...
Read more >
sql server - Very slow simple INSERT in transaction
Very slow simple INSERT in transaction · Open a SQL Server transaction · Insert a header row (1-5 msec) · Insert first item...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found