Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Check for MANUAL/NEVER flush mode properly (use FlushMode.isManualFlu…

…shMode)
  • Loading branch information...
commit 85c48ba2812fb5faaaacc56ab4dd8eeeec2cb2a9 1 parent 0371073
@lhotari lhotari authored
View
2  ...groovy/org/codehaus/groovy/grails/orm/hibernate/support/FlushOnRedirectEventListener.java
@@ -38,7 +38,7 @@ public FlushOnRedirectEventListener(SessionFactory sf) {
public void responseRedirected(String url) {
new GrailsHibernateTemplate(sessionFactory).execute(new HibernateCallback<Void>() {
public Void doInHibernate(Session session) {
- if (session.getFlushMode() != FlushMode.MANUAL) {
+ if (!FlushMode.isManualFlushMode(session.getFlushMode())) {
session.flush();
}
return null;
View
2  ...roovy/org/codehaus/groovy/grails/orm/hibernate/support/GrailsOpenSessionInViewFilter.java
@@ -69,7 +69,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
@Override
protected void closeSession(Session session, SessionFactory sessionFactory) {
- if (!FlushMode.MANUAL.equals(session.getFlushMode())) {
+ if (!FlushMode.isManualFlushMode(session.getFlushMode())) {
session.flush();
}
super.closeSession(session, sessionFactory);
View
2  .../org/codehaus/groovy/grails/orm/hibernate/support/GrailsOpenSessionInViewInterceptor.java
@@ -131,7 +131,7 @@ private GrailsContentBufferingResponse getContentBufferingResponse(HttpServletRe
@Override
protected void flushIfNecessary(Session session, boolean existingTransaction) throws HibernateException {
- if (session != null && session.getFlushMode() != FlushMode.MANUAL) {
+ if (session != null && !FlushMode.isManualFlushMode(session.getFlushMode())) {
super.flushIfNecessary(session, existingTransaction);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.