This is a trick question. By default Second level cache is already disabled in Hibernate.
In case, your project is using a second level cache you can use one of the following options to disable second level cache in Hibernate:
- We can set hibernate.cache.use_second_level_cache to false.
- We can use CacheMode.IGNORE to stop interaction between the session and second-level cache. Session will interact with cache only to invalidate cache items when updates occur