| 程序包 | 说明 |
|---|---|
| com.gemantic.dal.dao | |
| com.gemantic.dal.dao.cachehandler | |
| com.gemantic.dal.dao.cachehandler.impl |
| 限定符和类型 | 方法和说明 |
|---|---|
Map<Integer,UpdateInfo> |
ListHandlerCenter.getUpdateInfos(Object account_id,
Object obj,
Object oldObj) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
ListHandlerCenter.processUpdate(Object account_id,
Class clazz,
Object oldObj,
Object obj,
Map<Integer,UpdateInfo> updateInfos) |
| 限定符和类型 | 方法和说明 |
|---|---|
UpdateInfo |
ListHandler.getUpdateInfos(Object account_id,
Object obj,
Object oldObj,
Map<String,LsCacheInfoHelper> newObjLsMap,
Map<String,LsCacheInfoHelper> oldObjLsMap)
和对象更新相关的两个方法
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
ListHandler.processUpdate(Object account_id,
Class clazz,
Object oldObj,
Object obj,
UpdateInfo updateInfo) |
| 限定符和类型 | 方法和说明 |
|---|---|
UpdateInfo |
CommonListHandler.getUpdateInfos(Object account_id,
Object obj,
Object oldObj,
Map<String,LsCacheInfoHelper> newObjLsMap,
Map<String,LsCacheInfoHelper> oldObjLsMap)
核心 : 在DAL的这个模块中,依据的理念是---以人为本,系统中的某个List一定是某个人的
1 .同一个List,在同一时间只能由一个人修改, 此时如果缓存中没有这个List的ListInfo对象,则其他用户不能加载
2.
|
UpdateInfo |
AbstractListHandler.getUpdateInfos(Object account_id,
Object obj,
Object oldObj,
Map<String,LsCacheInfoHelper> newObjLsMap,
Map<String,LsCacheInfoHelper> oldObjLsMap)
参考 CommonListHandler --->getUpdateInfos 的说明,仅适合于非 主/从数据库分离的情况
查找因对象更新,导致的数据将发生变化的与对象相关的List,此处仅考虑对象的KeyProperty 和 orderByProperty 两个属性
场景一.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
CommonListHandler.processUpdate(Object account_id,
Class clazz,
Object oldObj,
Object obj,
UpdateInfo updateInfo)
更新数据库成功后,做的更新缓存动作
情况一 : 非读写分离:
处理逻辑: 将因对象变更,导致List数据发生变更的,《新/旧 对象》所对应的《新/旧 List》从缓存中删除
场景一: 会有两个List从缓存中删除
场景二: 会有一个List
情况二:读写分离
处理逻辑: 1) 从《旧对象》 所对应的 《旧List》中 将 《旧对象》删除
2) 将《新对象》 所对应的 《新List》从缓存中清除,并从主库中重新加载该List,直到加载出 新对象 所对应的 Section
|
void |
AbstractListHandler.processUpdate(Object account_id,
Class clazz,
Object oldObj,
Object obj,
UpdateInfo updateInfo)
参考 CommonListHandler --->getUpdateInfos 的说明,仅适合于非 主/从数据库分离的情况
简单粗暴的更新方式,直接从缓存中删除相应的List--- 我喜欢 ^_^
场景一 : 会从缓存中删除 2 个List
场景二 : 会从缓存中删除 1 个List
|
Copyright © 2021. All rights reserved.