SqlTransaction problem after some time
See original GitHub issueGood 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:
- Created 6 years ago
- Reactions:1
- Comments:15 (5 by maintainers)
Top GitHub Comments
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.
@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?