SQL triggers, SP ans service broker objects #18
Replies: 4 comments 5 replies
-
Hi @cbealperto08, thx for reaching me out. Christian unfortunately left his project and there are some open issues in his repository. I tried to fix some of them in my SqlTableDependency.Extensions package. Did you try it out? It also contains a reconnection mechanism, so you can reuse your existing triggers etc.
See also Wiki- How-to-convert-from-SqlTableDependency-to-SqlTableDependencyProvider I'm not using this approach anymore, I started to work on a more loosely coupled approach via Kafka sink connectors. See my newest project https://github.com/tomasfabian/ksqlDB.RestApi.Client-DotNet#cdc---push-notifications-from-sql-server-tables-with-kafka. You can actually execute continuous push queries against your table change records thx to the stream-table duality. We can discuss this too. I would like to help the .NET community as much as I can. @lekrus does my package solve most of the issues with not auto deleted objects in SqlTableDependency? Could you please join the discussion please, too? I remember you from issues #11, #13. Thank you, Tomas. |
Beta Was this translation helpful? Give feedback.
-
I forgot to mention that you can also horizontally scale Kafka Connect (or ksqldb). Regards Tomas Fabian |
Beta Was this translation helpful? Give feedback.
-
Hey @tomasfabian . In his code there are two places where the sql objects can be dropped, in one of the stored procedures associated to one of the sql service queues and the table trigger. In your version its only in the stored procedure. From what i can tell by default the sql conversation endpoint has a dialog timer set for about 180 seconds (from the base sqldependency table) which if it triggers it runs the portion of the stored procedure that drops all the sql objects. The sql table dependecy component updates this value while the connection is active. In christiandelbianco's trigger it also checks if the conversation is active. if it is it sends the appropriate dml changes to the appropriate service queues. if not, it drops the sql objects associated to the table dependency. The problem with christiandelbianco's trigger code is that the cursor can be an issue as part of a trigger. it can lock up resources especially if there are multiple table dependency triggers for the same table. if one of them locks up when dropping it's conversation handles it can prevent any of the other triggers from running properly. This is what I believe @tomasfabian's said in his comment at IsNemoEqualTrue/monitor-table-change-with-sqltabledependency#188 My suggestion is replace the cursor with a while loop that gets the top associated conversation handle. while the query returns a non-zero rowcount it drops the conversation handle, then queries again for any other associated conversation handles. I made the comment in sqltableDepenency project at IsNemoEqualTrue/monitor-table-change-with-sqltabledependency#188. |
Beta Was this translation helpful? Give feedback.
-
@pailyn thx for your great insights! It looks like that Christian solved the issue based on my suggestion, but he unfortunatelly introduced another bug, when he put the drop logic inside the trigger, too. As we discussed before we can't be sure whether my version is correct, since we are not able to reproduce this issue. Please try out the current version of SqlTableDependencyWithReconnection, too. Hopefully someone who is using this extenion extensively will respond us. In case that everything is OK, we can still create a simplified base class, without the reconnection logic. Thank you very much. |
Beta Was this translation helpful? Give feedback.
-
Hi, I read that christian is not maintaining the project anymore and this in the most recent activity. My question is about the
start method if the timeouts are not set does is mean that the SL server will not auto delete the objects created when not properly disposed? My database is now flooded with objects and almost everyday we encounter locks from the trigger saying
tr_dbo_PRODUCTION_ATE_1d9ce1de-fb8d-4494-85dc-a251e0cfa641_Sender. Hope you can guide me for the best practice.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions