0
即使在春季應用程序進程外插入/更新表,是否可以從彈簧監聽表插入或更新?使用彈簧的表監聽器
即使在春季應用程序進程外插入/更新表,是否可以從彈簧監聽表插入或更新?使用彈簧的表監聽器
一個建議:你需要做一些額外的工作基礎上,你的RDBMS
- Create triggers for each of your listening tables, this trigger
should base on a new change on these table to update information to
somewhere else
- Create a table (named: datalogger)to store the data come from the trigger above, for example, when table1 has new record inserted, the
trigger (named: trigger1) on table1 will be execute by RDBMS, then
trigger1 will insert a new record into datalogger which describes
the action event is "inserted", table name is "table1", and the
inserted record id is "new_recordId" as example. The same process
need to be applied for modifying action.
- On your application, create a job, which will try to query the datalogger table periodically, (1ms, 10ms,... as your requirement)
to find is there a new record in that table, if any, read the new
record and find out what happened with your database based on the
new record (determine by time or auto-increment id,..)