File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
hibernate-core/src/main/java/org/hibernate/query Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -180,16 +180,28 @@ protected void beforeQuery() {
180180
181181 session .prepareForQueryExecution ( requiresTxn ( options .getLockOptions ().getLockMode () ) );
182182 prepareForExecution ();
183+ prepareSessionFlushMode ( session );
184+ prepareSessionCacheMode ( session );
185+ }
183186
184- assert sessionFlushMode == null ;
185- assert sessionCacheMode == null ;
186187
188+ /*
189+ * Used by Hibernate Reactive
190+ */
191+ protected void prepareSessionFlushMode (SharedSessionContractImplementor session ) {
192+ assert sessionFlushMode == null ;
187193 final var effectiveFlushMode = getQueryOptions ().getFlushMode ();
188194 if ( effectiveFlushMode != null && session instanceof SessionImplementor statefulSession ) {
189195 sessionFlushMode = statefulSession .getHibernateFlushMode ();
190196 statefulSession .setHibernateFlushMode ( effectiveFlushMode );
191197 }
198+ }
192199
200+ /*
201+ * Used by Hibernate Reactive
202+ */
203+ protected void prepareSessionCacheMode (SharedSessionContractImplementor session ) {
204+ assert sessionCacheMode == null ;
193205 final var effectiveCacheMode = getCacheMode ();
194206 if ( effectiveCacheMode != null ) {
195207 sessionCacheMode = session .getCacheMode ();
Original file line number Diff line number Diff line change @@ -722,14 +722,17 @@ protected void prepareForExecution() {
722722 getSession ().flush ();
723723 }
724724 // Reset the callback before every execution
725- callback = null ;
725+ resetCallback () ;
726726 }
727727 // Otherwise, the application specified query spaces via the Hibernate
728728 // SynchronizeableQuery and so the query will already perform a partial
729729 // flush according to the defined query spaces - no need for a full flush.
730730 }
731731
732- private boolean shouldFlush () {
732+ /*
733+ * Used by Hibernate Reactive
734+ */
735+ protected boolean shouldFlush () {
733736 if ( getSession ().isTransactionInProgress () ) {
734737 final var flushMode = getQueryOptions ().getFlushMode ();
735738 return switch ( flushMode == null ? getSession ().getHibernateFlushMode () : flushMode ) {
You can’t perform that action at this time.
0 commit comments