Class SessionCacheModeThreadLocal
- java.lang.Object
-
- com.atlassian.confluence.core.persistence.hibernate.SessionCacheModeThreadLocal
-
public class SessionCacheModeThreadLocal extends Object
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 Constructor Description SessionCacheModeThreadLocal()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CacheMode
get()
static void
set(CacheMode mode)
Set cache mode for Hibernate sessions in current threadstatic Cleanup
temporarilySetCacheMode(CacheMode cacheMode)
Temporarily set the CacheMode within a try-with-resources code block.
-
-
-
Method Detail
-
get
public static CacheMode get()
- Returns:
- current cache mode of Hibernate sessions. Default to
DEFAULT_CACHE_MODE
-
set
public static void set(CacheMode mode)
Set cache mode for Hibernate sessions in current thread- Parameters:
mode
- cache mode
-
-