This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new ef5d07fcf41f CAMEL-26996: camel-jdbc, camel-sql - a StreamList that 
failed to read a row keeps failing, so a redelivered split no longer succeeds 
with part of the rows (#30082)
ef5d07fcf41f is described below

commit ef5d07fcf41f5da535ce8d38c934d89e3f114034
Author: Federico Mariani <[email protected]>
AuthorDate: Sun Nov 15 19:04:50 2026 +0100

    CAMEL-26996: camel-jdbc, camel-sql - a StreamList that failed to read a row 
keeps failing, so a redelivered split no longer succeeds with part of the rows 
(#30082)
    
    Co-authored-by: Claude <[email protected]>
---
 .../apache/camel/catalog/docs/jdbc-component.adoc  |   4 +
 .../apache/camel/catalog/docs/sql-component.adoc   |   3 +
 .../camel-jdbc/src/main/docs/jdbc-component.adoc   |   4 +
 .../camel/component/jdbc/ResultSetIterator.java    |  14 ++
 .../JdbcProducerStreamListReadFailureTest.java     | 170 +++++++++++++++++++++
 .../camel-sql/src/main/docs/sql-component.adoc     |   3 +
 .../camel/component/sql/ResultSetIterator.java     |  14 ++
 .../sql/SqlProducerStreamListReadFailureTest.java  | 166 ++++++++++++++++++++
 .../ROOT/pages/camel-4x-upgrade-guide-4_24.adoc    |   8 +
 9 files changed, 386 insertions(+)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/jdbc-component.adoc
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/jdbc-component.adoc
index 96f9b8bc23d8..d92c924311c3 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/jdbc-component.adoc
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/jdbc-component.adoc
@@ -64,6 +64,10 @@ column when it has one column, or `null` when there is no 
row, and
 A statement that is not a select leaves the body as it is, with the count
 in the `CamelJdbcUpdateCount` header.
 
+When reading a row of a `StreamList` fails (for example, the connection is 
lost), the iterator keeps failing instead
+of ending, so a split that is redelivered over it fails too, rather than 
succeeding with the rows read before the
+failure.
+
 *Note:* This component fetches `ResultSetMetaData` to be able to return
 the column name as the key in the `Map`.
 
diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/sql-component.adoc
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/sql-component.adoc
index 5178ca0973b2..6cd103995580 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/sql-component.adoc
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/sql-component.adoc
@@ -212,6 +212,9 @@ YAML::
 The producer supports `outputType=StreamList` that uses an iterator to stream 
the output of the query.
 This allows processing the data in a streaming fashion which, for example,
 can be used by the Splitter EIP to process each row one at a time, and load 
data from the database as needed.
+The rows can be read once: when reading a row fails (for example, the 
connection is lost), the iterator keeps failing
+instead of ending, so a split that is redelivered over it fails too, rather 
than succeeding with the rows read before
+the failure.
 
 [tabs]
 ====
diff --git a/components/camel-jdbc/src/main/docs/jdbc-component.adoc 
b/components/camel-jdbc/src/main/docs/jdbc-component.adoc
index 96f9b8bc23d8..d92c924311c3 100644
--- a/components/camel-jdbc/src/main/docs/jdbc-component.adoc
+++ b/components/camel-jdbc/src/main/docs/jdbc-component.adoc
@@ -64,6 +64,10 @@ column when it has one column, or `null` when there is no 
row, and
 A statement that is not a select leaves the body as it is, with the count
 in the `CamelJdbcUpdateCount` header.
 
+When reading a row of a `StreamList` fails (for example, the connection is 
lost), the iterator keeps failing instead
+of ending, so a split that is redelivered over it fails too, rather than 
succeeding with the rows read before the
+failure.
+
 *Note:* This component fetches `ResultSetMetaData` to be able to return
 the column name as the key in the `Map`.
 
diff --git 
a/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/ResultSetIterator.java
 
b/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/ResultSetIterator.java
index 99c1dab505a3..21379a68db66 100644
--- 
a/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/ResultSetIterator.java
+++ 
b/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/ResultSetIterator.java
@@ -43,6 +43,8 @@ public class ResultSetIterator implements 
Iterator<Map<String, Object>> {
     private final Column[] columns;
     private final boolean useGetBytes;
     private final AtomicBoolean closed = new AtomicBoolean();
+    // set when reading a row has failed: the rest of the result cannot be 
read, so the iterator must not look finished
+    private volatile SQLException failure;
 
     public ResultSetIterator(Connection conn, ResultSet resultSet, boolean 
isJDBC4, boolean useGetBytes) throws SQLException {
         this.resultSet = resultSet;
@@ -69,8 +71,19 @@ public class ResultSetIterator implements 
Iterator<Map<String, Object>> {
         loadNext();
     }
 
+    /**
+     * Whether there are more rows.
+     *
+     * @throws RuntimeCamelException when reading a row has failed before, as 
whether there are more rows is then
+     *                               unknown (whoever reads the iterator 
again, such as a redelivered split, gets an
+     *                               error and not the end of the rows)
+     */
     @Override
     public boolean hasNext() {
+        SQLException cause = failure;
+        if (cause != null) {
+            throw new RuntimeCamelException("Cannot process result: reading a 
row failed before", cause);
+        }
         return !closed.get();
     }
 
@@ -92,6 +105,7 @@ public class ResultSetIterator implements 
Iterator<Map<String, Object>> {
             loadNext();
             return row;
         } catch (SQLException e) {
+            failure = e;
             close();
             throw new RuntimeCamelException("Cannot process result", e);
         }
diff --git 
a/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcProducerStreamListReadFailureTest.java
 
b/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcProducerStreamListReadFailureTest.java
new file mode 100644
index 000000000000..47429a4a2768
--- /dev/null
+++ 
b/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcProducerStreamListReadFailureTest.java
@@ -0,0 +1,170 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.jdbc;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Proxy;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import javax.sql.DataSource;
+
+import org.apache.camel.BindToRegistry;
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.jupiter.api.Test;
+import org.springframework.jdbc.datasource.DelegatingDataSource;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+/**
+ * With {@code outputType=StreamList} the rows are read while the route runs. 
Once reading a row has failed (e.g. the
+ * connection is lost), the iterator must not look finished: a split that is 
redelivered over it must fail again, not
+ * succeed with the rows read before the failure.
+ */
+public class JdbcProducerStreamListReadFailureTest extends 
AbstractJdbcTestSupport {
+
+    private static final String QUERY = "select * from customer order by id";
+
+    @BindToRegistry("failing")
+    private FailingReadsDataSource failing;
+
+    @EndpointInject("mock:row")
+    private MockEndpoint row;
+
+    @Override
+    public void setupResources() {
+        super.setupResources();
+        failing = new FailingReadsDataSource(db);
+    }
+
+    @Test
+    public void readFailureFailsTheExchange() throws Exception {
+        row.expectedMessageCount(1);
+
+        Exchange out = template.send("direct:split", e -> 
e.getMessage().setBody(QUERY));
+
+        MockEndpoint.assertIsSatisfied(context);
+        assertFailedReadingARow(out.getException());
+    }
+
+    @Test
+    public void readFailureFailsTheExchangeWhenTheSplitIsRedelivered() throws 
Exception {
+        row.expectedMessageCount(1);
+
+        Exchange out = template.send("direct:splitWithRedelivery", e -> 
e.getMessage().setBody(QUERY));
+
+        MockEndpoint.assertIsSatisfied(context);
+        // each redelivery of the split fails too, instead of finding no more 
rows
+        assertFailedReadingARow(out.getException());
+        assertEquals(2, 
out.getMessage().getHeader(Exchange.REDELIVERY_COUNTER, Integer.class));
+    }
+
+    @Test
+    public void iteratorKeepsFailingOnceReadingARowHasFailed() throws 
Exception {
+        try (Connection conn = failing.getConnection(); Statement stmt = 
conn.createStatement()) {
+            ResultSet rs = stmt.executeQuery(QUERY);
+            ResultSetIterator rows = new ResultSetIterator(conn, rs, true, 
false);
+            assertEquals("cust1", rows.next().get("ID"));
+
+            failing.failReads = true;
+            RuntimeCamelException failure = 
assertThrows(RuntimeCamelException.class, rows::next);
+            SQLException cause = assertFailedReadingARow(failure);
+
+            assertSame(cause, assertThrows(RuntimeCamelException.class, 
rows::hasNext).getCause());
+            assertSame(cause, assertThrows(RuntimeCamelException.class, 
rows::next).getCause());
+            rows.close();
+            assertSame(cause, assertThrows(RuntimeCamelException.class, 
rows::hasNext).getCause());
+        }
+    }
+
+    private static SQLException assertFailedReadingARow(Exception exception) {
+        RuntimeCamelException failure = 
assertInstanceOf(RuntimeCamelException.class, exception);
+        SQLException cause = assertInstanceOf(SQLException.class, 
failure.getCause());
+        assertEquals("08006", cause.getSQLState());
+        return cause;
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            @Override
+            public void configure() {
+                from("direct:split").to("jdbc:failing?outputType=StreamList")
+                        .split(body()).streaming()
+                            // reading the rows fails after the first one
+                            .process(e -> failing.failReads = true)
+                            .to("mock:row")
+                        .end();
+
+                from("direct:splitWithRedelivery")
+                        
.errorHandler(defaultErrorHandler().maximumRedeliveries(2).redeliveryDelay(0))
+                        .to("jdbc:failing?outputType=StreamList")
+                        .split(body()).streaming()
+                            // reading the rows fails after the first one
+                            .process(e -> failing.failReads = true)
+                            .to("mock:row")
+                        .end();
+            }
+        };
+    }
+
+    /**
+     * Once {@link #failReads} is set, moving a result set to its next row 
fails, as when fetching the next rows from
+     * the database fails because the connection is lost.
+     */
+    private static final class FailingReadsDataSource extends 
DelegatingDataSource {
+
+        private volatile boolean failReads;
+
+        private FailingReadsDataSource(DataSource database) {
+            super(database);
+        }
+
+        @Override
+        public Connection getConnection() throws SQLException {
+            return (Connection) wrap(Connection.class, super.getConnection());
+        }
+
+        /** Wraps the statements and result sets that the target hands out 
too. */
+        private Object wrap(Class<?> type, Object target) {
+            return Proxy.newProxyInstance(getClass().getClassLoader(), new 
Class<?>[] { type }, (proxy, method, args) -> {
+                if (failReads && target instanceof ResultSet && 
"next".equals(method.getName())) {
+                    throw new SQLException("An I/O error occurred while 
sending to the backend.", "08006");
+                }
+                Object result;
+                try {
+                    result = method.invoke(target, args);
+                } catch (InvocationTargetException e) {
+                    throw e.getCause();
+                }
+                if ((result instanceof Statement || result instanceof 
ResultSet) && method.getReturnType().isInterface()) {
+                    return wrap(method.getReturnType(), result);
+                }
+                return result;
+            });
+        }
+    }
+}
diff --git a/components/camel-sql/src/main/docs/sql-component.adoc 
b/components/camel-sql/src/main/docs/sql-component.adoc
index 5178ca0973b2..6cd103995580 100644
--- a/components/camel-sql/src/main/docs/sql-component.adoc
+++ b/components/camel-sql/src/main/docs/sql-component.adoc
@@ -212,6 +212,9 @@ YAML::
 The producer supports `outputType=StreamList` that uses an iterator to stream 
the output of the query.
 This allows processing the data in a streaming fashion which, for example,
 can be used by the Splitter EIP to process each row one at a time, and load 
data from the database as needed.
+The rows can be read once: when reading a row fails (for example, the 
connection is lost), the iterator keeps failing
+instead of ending, so a split that is redelivered over it fails too, rather 
than succeeding with the rows read before
+the failure.
 
 [tabs]
 ====
diff --git 
a/components/camel-sql/src/main/java/org/apache/camel/component/sql/ResultSetIterator.java
 
b/components/camel-sql/src/main/java/org/apache/camel/component/sql/ResultSetIterator.java
index 126eb3e09972..078b0c3c67fe 100644
--- 
a/components/camel-sql/src/main/java/org/apache/camel/component/sql/ResultSetIterator.java
+++ 
b/components/camel-sql/src/main/java/org/apache/camel/component/sql/ResultSetIterator.java
@@ -40,6 +40,8 @@ public class ResultSetIterator implements Iterator<Object>, 
Closeable {
     private final RowMapper<?> rowMapper;
     private final AtomicBoolean closed = new AtomicBoolean();
     private int rowNum;
+    // set when reading a row has failed: the rest of the result cannot be 
read, so the iterator must not look finished
+    private volatile SQLException failure;
 
     public ResultSetIterator(Connection connection, Statement statement, 
ResultSet resultSet,
                              RowMapper<?> rowMapper) throws SQLException {
@@ -51,8 +53,19 @@ public class ResultSetIterator implements Iterator<Object>, 
Closeable {
         loadNext();
     }
 
+    /**
+     * Whether there are more rows.
+     *
+     * @throws RuntimeCamelException when reading a row has failed before, as 
whether there are more rows is then
+     *                               unknown (whoever reads the iterator 
again, such as a redelivered split, gets an
+     *                               error and not the end of the rows)
+     */
     @Override
     public boolean hasNext() {
+        SQLException cause = failure;
+        if (cause != null) {
+            throw new RuntimeCamelException("Cannot process result: reading a 
row failed before", cause);
+        }
         return !closed.get();
     }
 
@@ -67,6 +80,7 @@ public class ResultSetIterator implements Iterator<Object>, 
Closeable {
             loadNext();
             return next;
         } catch (SQLException e) {
+            failure = e;
             close();
             throw new RuntimeCamelException("Cannot process result", e);
         }
diff --git 
a/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlProducerStreamListReadFailureTest.java
 
b/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlProducerStreamListReadFailureTest.java
new file mode 100644
index 000000000000..165e570d512c
--- /dev/null
+++ 
b/components/camel-sql/src/test/java/org/apache/camel/component/sql/SqlProducerStreamListReadFailureTest.java
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.sql;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Proxy;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Map;
+
+import javax.sql.DataSource;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit6.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+import org.springframework.jdbc.core.ColumnMapRowMapper;
+import org.springframework.jdbc.datasource.DelegatingDataSource;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+/**
+ * With {@code outputType=StreamList} the rows are read while the route runs. 
Once reading a row has failed (e.g. the
+ * connection is lost), the iterator must not look finished: a split that is 
redelivered over it must fail again, not
+ * succeed with the rows read before the failure.
+ */
+public class SqlProducerStreamListReadFailureTest extends CamelTestSupport {
+
+    private EmbeddedDatabase db;
+    private FailingReadsDataSource failing;
+
+    @Override
+    public void doPreSetup() throws Exception {
+        db = new EmbeddedDatabaseBuilder()
+                .setName(getClass().getSimpleName())
+                .setType(EmbeddedDatabaseType.H2)
+                .addScript("sql/createAndPopulateDatabase.sql").build();
+        failing = new FailingReadsDataSource(db);
+    }
+
+    @Override
+    public void doPostTearDown() throws Exception {
+        if (db != null) {
+            db.shutdown();
+        }
+    }
+
+    @Test
+    public void readFailureFailsTheExchangeWhenTheSplitIsRedelivered() throws 
Exception {
+        MockEndpoint row = getMockEndpoint("mock:row");
+        row.expectedMessageCount(1);
+
+        Exchange out = template.send("direct:splitWithRedelivery", e -> 
e.getMessage().setBody("go"));
+
+        MockEndpoint.assertIsSatisfied(context);
+        // each redelivery of the split fails too, instead of finding no more 
rows
+        assertFailedReadingARow(out.getException());
+        assertEquals(2, 
out.getMessage().getHeader(Exchange.REDELIVERY_COUNTER, Integer.class));
+    }
+
+    @Test
+    public void iteratorKeepsFailingOnceReadingARowHasFailed() throws 
Exception {
+        try (Connection conn = failing.getConnection(); Statement stmt = 
conn.createStatement()) {
+            ResultSet rs = stmt.executeQuery("select * from projects order by 
id");
+            ResultSetIterator rows = new ResultSetIterator(conn, stmt, rs, new 
ColumnMapRowMapper());
+            assertEquals("Camel", ((Map<?, ?>) rows.next()).get("PROJECT"));
+
+            failing.failReads = true;
+            RuntimeCamelException failure = 
assertThrows(RuntimeCamelException.class, rows::next);
+            SQLException cause = assertFailedReadingARow(failure);
+
+            assertSame(cause, assertThrows(RuntimeCamelException.class, 
rows::hasNext).getCause());
+            assertSame(cause, assertThrows(RuntimeCamelException.class, 
rows::next).getCause());
+            // the splitter closes the iterator when the split fails
+            rows.close();
+            assertSame(cause, assertThrows(RuntimeCamelException.class, 
rows::hasNext).getCause());
+        }
+    }
+
+    private static SQLException assertFailedReadingARow(Exception exception) {
+        RuntimeCamelException failure = 
assertInstanceOf(RuntimeCamelException.class, exception);
+        SQLException cause = assertInstanceOf(SQLException.class, 
failure.getCause());
+        assertEquals("08006", cause.getSQLState());
+        return cause;
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            @Override
+            public void configure() {
+                getContext().getComponent("sql", 
SqlComponent.class).setDataSource(failing);
+
+                from("direct:splitWithRedelivery")
+                        
.errorHandler(defaultErrorHandler().maximumRedeliveries(2).redeliveryDelay(0))
+                        .to("sql:select * from projects order by 
id?outputType=StreamList")
+                        .split(body()).streaming()
+                            // reading the rows fails after the first one
+                            .process(e -> failing.failReads = true)
+                            .to("mock:row")
+                        .end();
+            }
+        };
+    }
+
+    /**
+     * Once {@link #failReads} is set, moving a result set to its next row 
fails, as when fetching the next rows from
+     * the database fails because the connection is lost.
+     */
+    private static final class FailingReadsDataSource extends 
DelegatingDataSource {
+
+        private volatile boolean failReads;
+
+        private FailingReadsDataSource(DataSource database) {
+            super(database);
+        }
+
+        @Override
+        public Connection getConnection() throws SQLException {
+            return (Connection) wrap(Connection.class, super.getConnection());
+        }
+
+        /** Wraps the statements and result sets that the target hands out 
too. */
+        private Object wrap(Class<?> type, Object target) {
+            return Proxy.newProxyInstance(getClass().getClassLoader(), new 
Class<?>[] { type }, (proxy, method, args) -> {
+                if (failReads && target instanceof ResultSet && 
"next".equals(method.getName())) {
+                    throw new SQLException("An I/O error occurred while 
sending to the backend.", "08006");
+                }
+                Object result;
+                try {
+                    result = method.invoke(target, args);
+                } catch (InvocationTargetException e) {
+                    throw e.getCause();
+                }
+                if ((result instanceof Statement || result instanceof 
ResultSet) && method.getReturnType().isInterface()) {
+                    return wrap(method.getReturnType(), result);
+                }
+                return result;
+            });
+        }
+    }
+}
diff --git 
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc 
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
index 6710ec85dbe7..9fc52bd31d2c 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
@@ -2101,6 +2101,14 @@ headers, as before. A `CamelJdbcParameters` header that 
is not a `Map` (such as
 with plain `?` placeholders in the same route) is now ignored for named 
parameters, where before it made the exchange
 fail with `Cannot find key`.
 
+=== camel-jdbc, camel-spring-jdbc, camel-sql - outputType=StreamList: a result 
that failed to read keeps failing
+
+With `outputType=StreamList`, once reading a row has failed (for example, the 
connection was lost), the iterator of
+the body no longer looks finished: `hasNext()` and `next()` now throw a 
`RuntimeCamelException` with the first
+`SQLException` as cause, also after the iterator is closed. Before, 
`hasNext()` returned `false`, so a split that was
+redelivered over the same iterator (an error handler with redeliveries) found 
no more rows and the exchange succeeded
+with only the rows read before the failure. It now fails once the redeliveries 
are exhausted.
+
 === camel-jgroups-raft - a body that does not convert to a byte array fails 
the exchange
 
 The `jgroups-raft` producer skipped a message body that has no conversion to 
`byte[]`, such as a `Map`, a POJO or a

Reply via email to