二级缓存需要三部缺一不可


大配置:

二级缓冲


小配置

二级缓冲



实体类继承serializable


二级缓冲



单侧:

 @Test
    //二级缓存
    public void hc(){
      SqlSession session = util.getsql();
      IStudentDao dao = session.getMapper(IStudentDao.class);
      Studentinfo studentinfo = dao.getstudentByid(6);
      System.out.println(studentinfo.getStuName());
      session.close();

      System.out.println("===================================================");

      SqlSession session2 = util.getsql();
      IStudentDao dao2 = session2.getMapper(IStudentDao.class);
      Studentinfo studentinfo1 = dao2.getstudentByid(6);
      System.out.println(studentinfo1.getStuName());


  }
}

相关文章:

  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2021-11-19
  • 2021-12-20
  • 2021-06-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2021-09-18
  • 2021-11-19
  • 2021-11-19
  • 2022-01-10
相关资源
相似解决方案