camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [3/3] git commit: CAMEL-7686: camel-jdbc - Fix this issue report about retriving generated keys
Date Wed, 13 Aug 2014 10:01:12 GMT
CAMEL-7686: camel-jdbc - Fix this issue report about retriving generated keys


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/da0df82d
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/da0df82d
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/da0df82d

Branch: refs/heads/camel-2.12.x
Commit: da0df82dffd32a453419e628b78dc8166734dda3
Parents: 7507c49
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Wed Aug 13 12:00:33 2014 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Aug 13 12:00:58 2014 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/camel/component/jdbc/JdbcProducer.java   | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/da0df82d/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java
b/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java
index 0446fb7..731fe51 100644
--- a/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java
+++ b/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java
@@ -189,6 +189,9 @@ public class JdbcProducer extends DefaultProducer {
                 setResultSet(exchange, rs);
             } else {
                 int updateCount = stmt.getUpdateCount();
+                // preserve headers
+                exchange.getOut().getHeaders().putAll(exchange.getIn().getHeaders());
+                // and then set the new header
                 exchange.getOut().setHeader(JdbcConstants.JDBC_UPDATE_COUNT, updateCount);
             }
 


Mime
View raw message