mysql视图数据没有更新数据类型_mysql 视图的数据刷新存在延迟

问题描述

请问一下各位大佬,我在一个请求中更新了一个mysql表的数据,请求结束以后立马在另一个请求中查询包含这个表的视图,会查到修改之前的旧数据,在请求一次才能查到新的数据了,而且不是每次都会出现这种情况。select h.*,i.staff_name person_name from (SELECT

a.ec_id AS ec_id,

a.region_id AS region_id,

e.region_name AS region_name,

a.production_process_id as production_process_id,

a.production_process_name as production_process_name,

a.production_process_type as production_process_type,

g.entry_name as production_process_type_name,

a.entity_id AS entity_id,

a.create_time as create_time,

a.create_id as create_id,

a.status as status,

max(IF ((d.tag = 'BeginTime'),b.attr_value,NULL)) AS begin_time,

max(IF ((d.tag = 'EndTime'),b.attr_value,NULL)) AS end_time,

max(IF ((d.tag = 'Person'),b.attr_value,NULL)) AS person,

max(IF ((d.tag = 'Event'),b.attr_value,NULL)) AS event

FROM erp_production_process a

LEFT JOIN (select * from entity_attr_value where inure_time <= now() and expire_time >now()) b on b.instance_id = a.production_process_id

left join entity_attr_cfg c on c.attr_id = b.attr_id and c.entity_id = a.entity_id

left join entity_attr_lib d on d.attr_id = b.attr_id

left join ec_produce_region e on e.region_id = a.region_id,

dict_def g

WHERE g.dict_type = 2003

and g.dict_class = 1003

and g.entry_id = a.production_process_type

GROUP BY

a.ec_id ,

a.production_process_id ,

a.production_process_name ,

a.production_process_type ,

g.entry_name ,

a.entity_id ,

a.create_time ,

a.create_id ,

a.status )h

left join ec_staff i on i.staff_id = h.person

;

问题出现的环境背景及自己尝试过哪些方法

我的项目是用spring-boot+mybatis开发的

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值