2016-11-07 4 views
1

apache-camel sql-batch 삽입을 사용하고 있습니다. 다음과 같이 SQL 일괄 삽입에 대한 나의 경로입니다 :이 경로에 대해 자동 커밋 거짓을 구성 할autocommit을 false로 설정하는 방법 apache camel sql batch insertion?

<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 ... 일괄 삽입을 위해 mybatis를 사용할 때 자동 커밋은 mybatis 프레임 워크에 의해 false로 설정됩니다. 어떻게 비행기 SQL을 사용하여 동일한 작업을 수행 할 수 있습니까?

답변

1

데이터 소스 (defaultAutoCommit)의 설정에서 자동 연결을 설정할 수 있습니다.

1

Camel SQL 구성 요소는 Spring의 JDBC 지원을 사용하므로 경로를 transacted으로 표시하는 유일한 방법은 전체 경로가 완료된 후에 커밋을 수행하는 것입니다.