Skip to content

[#1668] Throw correct exception when onFlush is called #1674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@
import org.hibernate.event.spi.FlushEvent;
import org.hibernate.event.spi.FlushEventListener;
import org.hibernate.reactive.event.ReactiveFlushEventListener;
import org.hibernate.reactive.logging.impl.Log;
import org.hibernate.reactive.session.ReactiveSession;
import org.hibernate.stat.spi.StatisticsImplementor;

import static java.lang.invoke.MethodHandles.lookup;
import static org.hibernate.reactive.logging.impl.LoggerFactory.make;
import static org.hibernate.reactive.util.impl.CompletionStages.voidFuture;

/**
Expand All @@ -24,6 +27,8 @@
public class DefaultReactiveFlushEventListener extends AbstractReactiveFlushingEventListener
implements ReactiveFlushEventListener, FlushEventListener {

private static final Log LOG = make( Log.class, lookup() );

@Override
public CompletionStage<Void> reactiveOnFlush(FlushEvent event) throws HibernateException {
final EventSource source = event.getSession();
Expand Down Expand Up @@ -59,6 +64,6 @@ else if ( ((ReactiveSession) source).getReactiveActionQueue().hasAnyQueuedAction

@Override
public void onFlush(FlushEvent event) throws HibernateException {
throw new UnsupportedOperationException();
throw LOG.nonReactiveMethodCall( "reactiveOnFlush" );
}
}