org.codehaus.groovy.grails.orm.hibernate.support
Class GrailsOpenSessionInViewInterceptor

java.lang.Object
  extended by org.springframework.orm.hibernate4.support.OpenSessionInViewInterceptor
      extended by org.codehaus.groovy.grails.orm.hibernate.support.GrailsOpenSessionInViewInterceptor
All Implemented Interfaces:
org.springframework.web.context.request.AsyncWebRequestInterceptor, org.springframework.web.context.request.WebRequestInterceptor

public class GrailsOpenSessionInViewInterceptor
extends org.springframework.orm.hibernate4.support.OpenSessionInViewInterceptor

Extends the default spring OSIVI and doesn't flush the session if it has been set to MANUAL on the session itself.

Since:
0.5

Field Summary
protected  int flushMode
           
protected static java.lang.String IS_FLOW_REQUEST_ATTRIBUTE
           
 
Fields inherited from class org.springframework.orm.hibernate4.support.OpenSessionInViewInterceptor
logger, PARTICIPATE_SUFFIX
 
Constructor Summary
GrailsOpenSessionInViewInterceptor()
           
 
Method Summary
 void afterCompletion(org.springframework.web.context.request.WebRequest request, java.lang.Exception ex)
           
protected  org.codehaus.groovy.grails.web.sitemesh.GrailsContentBufferingResponse getContentBufferingResponse(javax.servlet.http.HttpServletResponse response)
           
 int getFlushMode()
           
 void postHandle(org.springframework.web.context.request.WebRequest request, org.springframework.ui.ModelMap model)
           
 void preHandle(org.springframework.web.context.request.WebRequest request)
           
 void setFlushMode(int flushMode)
           
 
Methods inherited from class org.springframework.orm.hibernate4.support.OpenSessionInViewInterceptor
afterConcurrentHandlingStarted, getParticipateAttributeName, getSessionFactory, openSession, setSessionFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IS_FLOW_REQUEST_ATTRIBUTE

protected static final java.lang.String IS_FLOW_REQUEST_ATTRIBUTE
See Also:
Constant Field Values

flushMode

protected int flushMode
Constructor Detail

GrailsOpenSessionInViewInterceptor

public GrailsOpenSessionInViewInterceptor()
Method Detail

preHandle

public void preHandle(org.springframework.web.context.request.WebRequest request)
               throws org.springframework.dao.DataAccessException
Specified by:
preHandle in interface org.springframework.web.context.request.WebRequestInterceptor
Overrides:
preHandle in class org.springframework.orm.hibernate4.support.OpenSessionInViewInterceptor
Throws:
org.springframework.dao.DataAccessException

postHandle

public void postHandle(org.springframework.web.context.request.WebRequest request,
                       org.springframework.ui.ModelMap model)
                throws org.springframework.dao.DataAccessException
Specified by:
postHandle in interface org.springframework.web.context.request.WebRequestInterceptor
Overrides:
postHandle in class org.springframework.orm.hibernate4.support.OpenSessionInViewInterceptor
Throws:
org.springframework.dao.DataAccessException

afterCompletion

public void afterCompletion(org.springframework.web.context.request.WebRequest request,
                            java.lang.Exception ex)
                     throws org.springframework.dao.DataAccessException
Specified by:
afterCompletion in interface org.springframework.web.context.request.WebRequestInterceptor
Overrides:
afterCompletion in class org.springframework.orm.hibernate4.support.OpenSessionInViewInterceptor
Throws:
org.springframework.dao.DataAccessException

getContentBufferingResponse

protected org.codehaus.groovy.grails.web.sitemesh.GrailsContentBufferingResponse getContentBufferingResponse(javax.servlet.http.HttpServletResponse response)

setFlushMode

public void setFlushMode(int flushMode)

getFlushMode

public int getFlushMode()