[英]How to enable database cache in my java application
I have a scenario where i have a database which will be updated at any time by end user... my java application need to cache the data once any change in the database is done? 我有一种情况,我有这将在任何时间通过最终用户更新的数据库......我的Java应用程序需要一次数据库中的所有变化做缓存的数据? How is it possible?
这怎么可能? Some one help me in clearing this issue?
有人帮我清理这个问题?
I would like to know how to cache the database data once any updates is made in the database? 我想知道如何缓存数据库的数据,一旦任何更新是在数据库中进行?
You can register a stored procedure as trigger that notifies your Java application about the update. 您可以将存储过程注册为触发器,以将更新通知给Java应用程序。 Read about triggers here: https://dev.mysql.com/doc/refman/5.7/en/trigger-syntax.html
阅读关于触发器在这里: https://dev.mysql.com/doc/refman/5.7/en/trigger-syntax.html
Your question can be interpreted in different ways: 您的问题可以用不同的方式解释:
The latter is much more difficult to achieve. 后者很难实现。 If consistency is required, then, at some point, the database transaction must wait until the application is notified and has acknowledged.
如果需要的一致性,然后,在某些时候,数据库事务必须等到申请通知的承认。 You will run into lots of interesting questions in the area of distributed computing.
你会遇到很多的分布式计算领域的有趣问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.