Class ContextManagerAdapter
java.lang.Object
ch.tocco.nice2.persist.core.impl.hibernate.legacy.ContextManagerAdapter
- All Implemented Interfaces:
- ContextManager
Manages and creates 
Context instances.
 At most one Context can be bound to a thread at the same time.
 The 'current' session/context is defined by the SessionFactoryManager (which in turn
 uses the ManagedSessionContext to store the current session).- 
Constructor SummaryConstructorsConstructorDescriptionContextManagerAdapter(TypeManager typeManager, SessionFactoryManager sessionFactoryManager, PersistenceService persistService, NiceDataModel dataModel, QueryCompiler queryCompiler) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidvoidClear and close the implicit context.Create a new context and attach it to the current thread.createNewContext(Integer queryTimeout) createNewContext(Connection connection) Create a new context using an existing connection.createNewContext(Connection connection, Integer socketTimeout) voidsetThreadContext(@Nullable Context ctx) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ch.tocco.nice2.persist.core.api.ContextManagernewContext
- 
Constructor Details- 
ContextManagerAdapterpublic ContextManagerAdapter(TypeManager typeManager, @Lazy SessionFactoryManager sessionFactoryManager, @Lazy PersistenceService persistService, @Lazy NiceDataModel dataModel, @Lazy QueryCompiler queryCompiler) 
 
- 
- 
Method Details- 
createNewContextDescription copied from interface:ContextManagerCreate a new context and attach it to the current thread.- Specified by:
- createNewContextin interface- ContextManager
 
- 
createNewContext- Specified by:
- createNewContextin interface- ContextManager
 
- 
createNewContextDescription copied from interface:ContextManagerCreate a new context using an existing connection. This can be useful in special circumstances when a context needs to use the same transaction as an already existing connection. Note: The connection is not closed when the context is closed!- Specified by:
- createNewContextin interface- ContextManager
 
- 
createNewContext- Specified by:
- createNewContextin interface- ContextManager
 
- 
setThreadContext- Specified by:
- setThreadContextin interface- ContextManager
 
- 
getThreadContext- Specified by:
- getThreadContextin interface- ContextManager
 
- 
clearImplicitContextpublic void clearImplicitContext()Description copied from interface:ContextManagerClear and close the implicit context. Should be called at the end of a test or request. Can also called when the implicit context is no longer needed to release the database connection.- Specified by:
- clearImplicitContextin interface- ContextManager
 
- 
addContextCreationListener- Specified by:
- addContextCreationListenerin interface- ContextManager
 
- 
removeContextCreationListener- Specified by:
- removeContextCreationListenerin interface- ContextManager
 
 
-