我正在使用apache-camel sql-批处理插入。我的sql批处理插入路径如下:
<pipeline>
<transform>
<method ref="insertionMyBean" method="myBatchInsertion"></method>
</transform>
<choice>
<when>
<simple>${in.header.myCount} == ${properties:batch.mySize}</simple>
<to uri="sql:{{sql.subs.insertMyBatchStatement}}?batch=true"></to>
<log message="Inserted rows ${body}"></log>
</when>
</choice>
</pipeline>我想为这个路由配置自动提交假。有人能帮我解决这个问题吗?FYI...When i使用mybatis进行批处理插入,mybatis框架将自动提交设置为false。在使用平面sql时,我如何做到这一点?
发布于 2016-11-07 10:31:52
可以在数据源设置(defaultAutoCommit)中设置自动提交。
发布于 2016-11-07 10:22:25
Camel SQL组件使用Spring的JDBC支持,因此唯一的方法(据我所知)是将路由标记为transacted -这样,一旦整个路由完成,提交就会发生。
https://stackoverflow.com/questions/40462009
复制相似问题