Home > database >  MySQL to have a mechanism, when some of the data update, notice to connect to the MySQL application?
MySQL to have a mechanism, when some of the data update, notice to connect to the MySQL application?

Time:09-29

MySQL to have a mechanism, when some of the data update, notice to connect to the MySQL applications, without the need for application of cyclic query these data?

CodePudding user response:

Mysql will not achieve this mechanism, the application of data has always been to read and write, message driven only by the application,

CodePudding user response:

I don't know

CodePudding user response:

Essentially a can use SqlDependency,
MySQL can oneself add a trigger, defines relevant information on your log tables, polling log table to implement,

CodePudding user response:

SQL server SqlDependency implementation are ultimately is to use the polling

CodePudding user response:

reference 4 floor ZJCXC response:
SQL server SqlDependency implementation are ultimately is to use the polling

SqlDependency is event notification, at least not to use a polling, the specific internal implementation did not know,

CodePudding user response:

reference 5 floor yenange reply:
Quote: refer to 4th floor ZJCXC response:

SQL server SqlDependency implementation are ultimately is to use the polling

SqlDependency is event notification, at least not to use a polling, specific internal implementation did not know that

Polling, it is through the Service Broker, polling the Queue, can see through the PROFILER polling request the transaction notice is issued, the component is not from the database server to trigger

CodePudding user response:

refer to 6th floor ZJCXC response:
Quote: refer to the fifth floor yenange reply:

Quote: refer to 4th floor ZJCXC response:

SQL server SqlDependency implementation are ultimately is to use the polling

SqlDependency is event notification, at least not to use a polling, specific internal implementation did not know that

Polling, it is through the Service Broker, polling the Queue, can see through the PROFILER polling request the transaction notice is issued, the component is not from the database server to trigger

Admire, good study in-depth

CodePudding user response:

Database must not, you want to achieve, big project will not do immediately persistent but the operation is in the cache and then batch submit operations to a thing, this belongs to control directly in the program to do things, then you can add the events in the things of mechanisms, such as. Net dataset of this type can cache database data and a variety of database operations, and there are a lot of this kind, what line change events, delete events and so on, throughout the operation of this notification is surely in the program for the best, even if the trigger is not recommended, because the trigger may cause some cascade reaction, and trigger notifications only within the database and will not notify the application

CodePudding user response:

Doesn't seem to be oh, should go through the program implementation

CodePudding user response:

SqlDependency before SQL Server 2005 version of the implementation, is to use the trigger + polling implementation, you can also consider the methods:
1. Inform all data tables set up the trigger, when data changes, the data change of the primary key and table name write a written record
2. Program polling the record, if you have check the changes to the data, then trigger the transaction notice change record name and id
This trigger is simple, small overhead, polling is not in the business on the table, also avoid some unnecessary influence

CodePudding user response:

Another alternative way is to study the MySQL binlog, write their own programs to disguised as a slave, data from Mr Khoja binlog get data change
Ali has a similar thing, if you develop strength, can draw lessons from
http://agapple.iteye.com/blog/1796633

CodePudding user response:

There is no
in MySQLPostgreSQL has this function, the server layer have LISTEN/NOTIFY statements, at the same time I rewrote the PSQLODBC, encapsulated in the ODBC NOTIFY/LISTEN, perfect in the C/S structure to support this feature
Refer to my blog
http://blog.csdn.net/trainee/article/details/1567565
  • Related