3.5 设定刷新缓存的时间点

  • 若希望改变flush的默认时间点,可以通过Session的setFlushMode()方法显示指定flush的时间点:
清理缓存的模式 查询方法 Transcation的commit()方法 Session的flush()方法
FlushMode.AUTO(Default) 清理 清理 清理
FlushMode.COMMIT 不清理 清理 清理
FlushMode.NEVER 不清理 不清理 清理