Class SessionCacheModeThreadLocal
java.lang.Object
com.atlassian.confluence.core.persistence.hibernate.SessionCacheModeThreadLocal
A thread local that stores the CacheMode during use of a session.
This is intended to replicate the functionality provided by Hibernate 3's org.hibernate.CacheMode.
- Since:
- 5.10
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
SessionCacheModeThreadLocal
public SessionCacheModeThreadLocal()
-
-
Method Details
-
get
- Returns:
- current cache mode of Hibernate sessions. Default to
DEFAULT_CACHE_MODE
-
set
Set cache mode for Hibernate sessions in current thread- Parameters:
mode
- cache mode
-
temporarilySetCacheMode
Temporarily set the CacheMode within a try-with-resources code block. For example:try (Cleanup restore = temporarilySetCacheMode(CacheMode.IGNORE)) { performImportInternal(context); }
-