MySQL Connector / NET checks for new table changes

I use MySQL Connector / NET and I want to check if there are any changes in the table, usually I use a timer and every time it ticks, it will check for new changes.

But a timer is not a good solution. every time my software needs to run a SELECT command that spends a lot of time and resources. I want to use an event instead of a timer that checks for new changes.

Someone told me to use SOCKS or something like that. Anyone have an idea?

+3
source share
1 answer

As aleroot noted, if you used MSSQL, then SqlDependency is exactly the answer you are looking for. But since you are using MySQL, we have few options.

The concept, known as WebSockets, was introduced in HTML 5. This is a type of PUSH technology. Although I'm not sure if it can be used in your script, go through the article available at: http://net.tutsplus.com/tutorials/javascript-ajax/start-using-html5-websockets-today/

The remaining option is to periodically query the database for any data changes. The following are some guidelines for reducing server load when using polling:

1) , ( ) .

2) , , . , , - .

.

+2

All Articles