1.1、Mybatis一级缓存测试
package me.gacl.test; import me.gacl.domain.User;
import me.gacl.util.MyBatisUtil; import org.apache.ibatis.session.SqlSession;
import org.junit.Test; public class TestOneLevelCache {
@Test
public void testCache1(){
SqlSession session = MyBatisUtil.getSqlSession();
String statement = "me.gacl.mapping.userMapper.getUser";
User user = session.selectOne(statement,1);
System.out.println(user); /**
* 一级缓存默认会被使用
*/
user = session.selectOne(statement, 1);
System.out.println(user);
session.close();
/**
* 1.必须是同一个session,如果session对象已经close()过了就 不可能用了
*/
session = MyBatisUtil.getSqlSession();
user = session.selectOne(statement, 1);
System.out.println(user);
/**
* 2.查询条件是一样的
*/
user = session.selectOne(statement,2);
System.out.println(user);
/**
* 3.没有执行session.clearCache()清理完毕
*
*/
user = session.selectOne(statement, 2);
System.out.println(user);
/**
* 4.没有执行过增删改的操作(这些操作都会清理缓存 )
*/
session.update("me.gacl.mapping.userMapper.updateUser",
new User(2,"user",23));
user = session.selectOne(statement, 2);
System.out.println(user); } }
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAABAQAAACfCAIAAADh65wrAAAgAElEQVR4nO3d77Mc1Xng8flzgvRy66pSXbVFbW0tL6hab7zJGhu8MAht27IxFAaEbRyz2M5gCTs0tlYi4LVkE/PrIiQUaNeSNYHEdlxZfPGWJCe1o9hRMBAoyZlY4epKVzD7oqf7POf0c053z8876u+npmBuT/c5p0/31X2e06enO4PBYDAYHD58+E9e+L+8ePHixYsXL168ePFqz6tDMsCLFy9evHjx4sWLVztfJhkAAAAA0CqjZAAAAABA25AMAAAAAC1FMgAAAAC0lJ4MnDp1atHzlwAAAADMlpsMFGnAsE2K7jh16tTsE7DFy3Z20a3AMlmWc2ZZ2gkAwBZhJQNZJrDoyHyRWpUVEDOhqWU5Z5alnQAALJxJBrJM4AN88MEHH3zQkpSAmAlNLcs5syztBABgsUbJAJmAakb5wB8/dmz11ZOrr57848eOTb3wpurETMefuvv4U3fPoTFYCuo588r/e7p43X741vCPC2wnAACQrGTg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OkiGQAAAABaimQAAAAAaCmSAQAAAKClSAYAAACAliIZAAAAAFqKZAAAAABoqaVJBho9Z2BaxKOYPQ8/nvg5Bmkc2KW04vHDVe3EcDjk+QMAAAA+y5QMzDmYE2F6GnfM47vS2ATos29VGlclA752QuLJxAAAAGVuMpCNeWcBZTagKkMo8WTfKCqCVDNObg1jZ0ujpJ9/bsJUvZwgJZiznkXb1z6IkiQ2n2rtlMs8pY1WU4PsSULMomq3BNGmOB0lAxO2s2Zj4jg2NReflfs5WzuK4ryN1iZN+nk+59uQZAAAAECjXBmwAso0LkIoGU7J0XEZZfWTyJrWksd32fusWF85YVoykMrsomized9PIhFchtpZoTw8nwfIE08TKu2XnDdUd5qQv53NWtIRPWdapfZzsXZ+NaI4bZr286zPt3JpAAAAyDRIBqwhYnUYWBtU1iIwrZwqSjBnVy3DWGUrTzurR9xljKztyYQhprtfTo/luzNhO2u2RD/u4X5O42zRaPPm/Tz7861oL8kAAACApVEyIKRxPiIbHI32B2elcioER9BFm+1kQDRgnFFz+9KCaqLB+GHtZKCykMnvj/Uc96p+dpKB5h0yn/ONZAAAAKBMTwbkaLo6zaYIAYfh0XEtOPOVE+YGczJKtgfF5YpJZM25aRQO+qYwySlJ7h27adzkakexH06SI2Pj6mlCoXWatEcPyn397E0GGvfzrM83txYAAADktG8Tkl+cKW7AtednWAGm9pGc42FtECgnoBzMiQkjURyb+1CtDyJrqwZVl6aj+O6olRul4nblKm7/dGS0a5bFFbcNhNrZoD1FMfltAJ2OmMbj9nMi1s7rkLcCNzvEMz7fikpIBgAAABxX+FeLzjkElBcitoKt1p4FIhkAAAAoW6ZkQIxWVxBj2ZN+208DfTmBaAvYau1ZGB46BgAAoFuaZAAAAADAdJEMAAAAAC1FMgAAAAC0FMkAAAAA0FIkAwAAAEBLkQwAAAAALUUyAAAAALQUyQAAAADQUv8f71699xPK2ZIAAAAASUVORK5CYII=" alt="" />
1.1、Mybatis一级缓存测试的更多相关文章
- MyBatis一级缓存引起的无穷递归
MyBatis一级缓存引起的无穷递归 引言: 最近在项目中参与了一个领取优惠劵的活动,当多个用户领取同一张优惠劵的时候,使用了数据库锁控制并发,起初的设想是:如果多个人同时领一张劵,第一个到达的人领取 ...
- MyBatis系列目录--5. MyBatis一级缓存和二级缓存(redis实现)
转载请注明出处哈:http://carlosfu.iteye.com/blog/2238662 0. 相关知识: 查询缓存:绝大数系统主要是读多写少. 缓存作用:减轻数据库压力,提供访问速度. 1. ...
- 0065 MyBatis一级缓存与二级缓存
数据库中数据虽多,但访问频率却不同,有的数据1s内就会有多次访问,而有些数据几天都没人查询,这时候就可以将访问频率高的数据放到缓存中,就不用去数据库里取了,提高了效率还节约了数据库资源 MyBatis ...
- Mybatis一级缓存和二级缓存 Redis缓存
一级缓存 Mybatis的一级缓存存放在SqlSession的生命周期,在同一个SqlSession中查询时,Mybatis会把执行的方法和参数通过算法生成缓存的键值,将键值和查询结果存入一个Map对 ...
- MyBatis 一级缓存与二级缓存
MyBatis一级缓存 MyBatis一级缓存默认开启,一级缓存为Session级别的缓存,在执行以下操作时一级缓存会清空 1.执行session.clearCache(); 2.执行CUD操作 3. ...
- mybatis一级缓存详解
mybatis缓存分为一级缓存,二级缓存和自定义缓存.本文重点讲解一级缓存 一:前言 在介绍缓存之前,先了解下mybatis的几个核心概念: * SqlSession:代表和数据库的一次会话,向用户提 ...
- Hibernate一级缓存测试分析
Hibernate 一级缓存测试分析 Hibernate的一级缓存就是指Session缓存,此Session非http的session会话技术,可以理解为JDBC的Connection,连接会话,Se ...
- MyBatis 一级缓存避坑
MyBatis 一级缓存(MyBaits 称其为 Local Cache)无法关闭,但是有两种级别可选: package org.apache.ibatis.session; /** * @autho ...
- 关于mybatis 一级缓存引发的问题
场景: 由于在一个方法中存在多个不同业务操作 private void insertOrUpdateField(CompanyReport entity) { //计算并数据 calcReportDa ...
随机推荐
- leetcode@ [124] Binary Tree Maximum Path Sum (DFS)
https://leetcode.com/problems/binary-tree-maximum-path-sum/ Given a binary tree, find the maximum pa ...
- Visual Studio 2008 – ASP.NET “System.Runtime.InteropServices.COMException”
The Issue When openning an existing ASP.NET project for the first time in Visual Studio 2008 it retu ...
- Python解释器
当我们编写Python代码时,我们得到的是一个包含Python代码的以.py为扩展名的文本文件.要运行代码,就需要Python解释器去执行.py文件. 由于整个Python语言从规范到解释器都是开源的 ...
- iOS 详解NSXMLParser方法解析XML数据方法
前一篇文章已经介绍了如何通过URL从网络上获取xml数据.下面介绍如何将获取到的数据进行解析. 下面先看看xml的数据格式吧! <?xml version="1.0" enc ...
- UI进阶 多线程
一.多线程概述 程序.进程.线程 程序:由源代码生成的可执行应用.(例如:QQ.app) 进程:一个正在运行的程序可以看做一个进程.(例如:正在运行的QQ就是一个进程),进程拥有独立运行所需的全部资源 ...
- js-弹出一个新窗口 新窗口自动转接到一个页面然后自动关闭
这个问题.好. 在百度问问找到的:他的做法是打开一个后通过实例对象,再进行一将跳转,最后再将JS里定时将实例对象关闭... 这个问题其实不需要两个页面,只要三行JS代码就能实现,除非你在2.php里面 ...
- WIN32不得不会:视频播放器
我愿分享我所有的技术,你可愿意做我的朋友? ----赵大哥 为何要写这篇博客 纯WIN32API打造,自认为对底层的理解略有帮助,和大家分享成果和知识点. 已经实现功能有:打开.播放.关闭功能. 核心 ...
- SAP ABAP 处理字符串串串串串串串串(详细)
关于ABAP中处理字符串的方法,非常详细,学习过程中总结一下分享给大家,,, ABAP/4 提供多个处理类型 C 即字符串 的数据对象的关键字. 处理字符串 的方法有: 1.拆分字符串split 2. ...
- .NET常用操作小知识
一..NET截取指定长度汉字超出部分以“.....”表示 /// <summary> /// 将指定字符串按指定长度进行剪切, /// </summary> /// <p ...
- C++ 构造和析构
1.继承关系可认为,子类在父类的基础上进行.从这个角度讲,可把它认为穿衣脱衣的过程.穿衣是:先穿内衣,再穿外套.脱衣是:先脱外套,在脱内衣.构造是:先调用父类构造方法,再调用子类构造方法.析构是:先调 ...