[jOOQ/jOOQ#14967] Reactive batch implementations should throw UnsupportedOperationException with a message

This commit is contained in:
Lukas Eder 2023-04-20 13:30:43 +02:00
parent 198e25ee6c
commit e16a82371e
4 changed files with 11 additions and 9 deletions

View File

@ -65,13 +65,6 @@ abstract class AbstractBatch implements Batch {
this.dsl = DSL.using(configuration);
}
@Override
public void subscribe(Subscriber<? super Integer> s) {
// [#11700] TODO: Implement this
throw new UnsupportedOperationException();
}
@Override
public final CompletionStage<int[]> executeAsync() {
return executeAsync(configuration.executorProvider().provide());

View File

@ -55,6 +55,8 @@ import org.jooq.exception.ControlFlowSignal;
import org.jooq.exception.DataAccessException;
import org.jooq.tools.JooqLogger;
import org.reactivestreams.Subscriber;
/**
* @author Lukas Eder
*/
@ -76,6 +78,13 @@ final class BatchCRUD extends AbstractBatch {
return records.length;
}
@Override
public void subscribe(Subscriber<? super Integer> s) {
// [#11700] TODO: Implement this
throw new UnsupportedOperationException("BatchCRUD operations are not yet supported in a reactive way. Use ordinary batch operations, instead, or avoid batching. See https://github.com/jOOQ/jOOQ/issues/14874");
}
@Override
public final int[] execute() throws DataAccessException {

View File

@ -80,7 +80,7 @@ final class BatchMultiple extends AbstractBatch {
// TODO: [#11700] Implement this
else
throw new UnsupportedOperationException();
throw new UnsupportedOperationException("The blocking, JDBC backed implementation of reactive batching has not yet been implemented. Use the R2DBC backed implementation, instead, or avoid batching.");
}
@Override

View File

@ -153,7 +153,7 @@ final class BatchSingle extends AbstractBatch implements BatchBindStep {
// TODO: [#11700] Implement this
else
throw new UnsupportedOperationException();
throw new UnsupportedOperationException("The blocking, JDBC backed implementation of reactive batching has not yet been implemented. Use the R2DBC backed implementation, instead, or avoid batching.");
}
@Override