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
MysqlDependency and UPDATE command
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: MysqlDependency and UPDATE command
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.
Send us a DDL script of your table and a small test project. Also describe steps we should perform to reproduce the issue.
-
- Posts: 5
- Joined: Thu 11 Jun 2015 09:09
Re: MysqlDependency and UPDATE command
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...
Thank you for your help, I'm really appreciating MysqlDependency!
Best regards
Giacomo
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...
Thank you for your help, I'm really appreciating MysqlDependency!
Best regards
Giacomo