graben commented on code in PR #17734:
URL: https://github.com/apache/camel/pull/17734#discussion_r2040585643


##########
components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlProducer.java:
##########
@@ -171,12 +171,12 @@ public Object doInPreparedStatement(PreparedStatement ps) 
throws SQLException {
                                 total += count;
                             }
                             
exchange.getIn().setHeader(SqlConstants.SQL_UPDATE_COUNT, total);
-                            if (manualCommit) {
+                            if (manualCommit && !restoreAutoCommit) {

Review Comment:
   > I wonder if there is any better way to check if we are running in a JTA 
transaction?
   
   You're right that there are better ways to identify JTA, but it's only one 
option why a connection has been set to auto commit before calling sql producer.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to