MySQL 监听通知等效

2021-12-19 00:00:00 events mysql triggers notify

是否有等效于 PostgresQL 的 notify 和 listen 在 MySQL 中?基本上,我需要在我的 Java 应用服务器中监听触发器.

Is there an equivalent of PostgresQL's notify and listen in MySQL? Basically, I need to listen to triggers in my Java application server.

推荐答案

不,目前还没有任何像这样的内置函数.您需要ping"(每 1-5 秒)数据库并选择读取"0/1 等预制标志.

No, there aren't any built-in functions like these yet. You need to "ping" (every 1-5 seconds) database with selecting with premade flag like "read" 0/1. After

SELECT * FROM mytable WHERE read = 0

用 read = 1 更新它

update it with read = 1

相关文章