Package org.grails.orm.hibernate
Class GrailsSessionContext
- java.lang.Object
-
- org.grails.orm.hibernate.GrailsSessionContext
-
- All Implemented Interfaces:
java.io.Serializable,org.hibernate.context.spi.CurrentSessionContext
public class GrailsSessionContext extends java.lang.Object implements org.hibernate.context.spi.CurrentSessionContextBased on org.springframework.orm.hibernate4.SpringSessionContext.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanallowCreateprotected org.hibernate.context.spi.CurrentSessionContextjtaSessionContextprotected org.hibernate.engine.spi.SessionFactoryImplementorsessionFactory
-
Constructor Summary
Constructors Constructor Description GrailsSessionContext(org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.springframework.transaction.support.TransactionSynchronizationcreateSpringFlushSynchronization(org.hibernate.Session session)protected org.springframework.transaction.support.TransactionSynchronizationcreateSpringSessionSynchronization(org.springframework.orm.hibernate5.SessionHolder sessionHolder)org.hibernate.SessioncurrentSession()Retrieve the Spring-managed Session for the current thread, if any.protected javax.transaction.TransactionManagergetJtaTransactionManager(org.hibernate.Session session)voidinitJta()protected voidregisterJtaSynchronization(org.hibernate.Session session, org.springframework.orm.hibernate5.SessionHolder sessionHolder)
-
-
-
Method Detail
-
initJta
public void initJta()
-
currentSession
public org.hibernate.Session currentSession() throws org.hibernate.HibernateExceptionRetrieve the Spring-managed Session for the current thread, if any.- Specified by:
currentSessionin interfaceorg.hibernate.context.spi.CurrentSessionContext- Throws:
org.hibernate.HibernateException
-
registerJtaSynchronization
protected void registerJtaSynchronization(org.hibernate.Session session, org.springframework.orm.hibernate5.SessionHolder sessionHolder)
-
getJtaTransactionManager
protected javax.transaction.TransactionManager getJtaTransactionManager(org.hibernate.Session session)
-
createSpringFlushSynchronization
protected org.springframework.transaction.support.TransactionSynchronization createSpringFlushSynchronization(org.hibernate.Session session)
-
createSpringSessionSynchronization
protected org.springframework.transaction.support.TransactionSynchronization createSpringSessionSynchronization(org.springframework.orm.hibernate5.SessionHolder sessionHolder)
-
-