MysqlDependency and UPDATE command

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
giacomo.galletto
Posts: 5
Joined: Thu 11 Jun 2015 09:09

MysqlDependency and UPDATE command

Post by giacomo.galletto » Thu 22 Sep 2016 15:16

Hello,

I'm testing MysqlDependency class to check if it could be of some use for my company and I am experiencing this situation that I am not able to understand.

I used a very simple table for the first test, with only three columns (the PK column and two varchar fields) and the OnChange event was fired when I performed an INSERT, an UPDATE and a DELETE command, as expected.

Then I tried a different table with one timestamp field with CURRENT_TIMESTAMP as default with timestamp update not enabled.
In this case, the OnChange event was fired when I performed an INSERT and a DELETE command but not when I performed an UPDATE command on the table.

I tried to change the value of every field of the table, event the timestamp field, without seeing the event fired.

Can you help me, please?

Best regards
Giacomo

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: MysqlDependency and UPDATE command

Post by Pinturiccio » Fri 23 Sep 2016 15:27

When you use MySqlDependency with table with a TIMESTAMP column, MySqlDependency processes only the rows, for which the TIMESTAMP column value was changed. If you update data in this row, but the TIMESTAMP column value stays the same, MySqlDependency won’t process this row.

Send us a DDL script of your table and a small test project. Also describe steps we should perform to reproduce the issue.

giacomo.galletto
Posts: 5
Joined: Thu 11 Jun 2015 09:09

Re: MysqlDependency and UPDATE command

Post by giacomo.galletto » Fri 23 Sep 2016 16:02

Hi Pinturiccio,

thank you very much for your reply.
I actually tried to modify even the value of a field in the timestamp column without seeing the event fired.
Anyway, I have to admit it was my fault because, as I read in some other forum topic, if a table has more than one timestamp column MysqlDependency considers only the first one.
Well, I was modifying the value of the second timestamp column... :oops:

Thank you for your help, I'm really appreciating MysqlDependency!

Best regards
Giacomo

Post Reply