Use a transacted client as described here [1] and chain your database
operations along within one transaction. If everything went fine, Camel
will commit the transaction, otherwise Camel will rollback the transaction.

[1] http://camel.apache.org/transactional-client.html

Best,

Christian
-----------------

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Tue, Aug 12, 2014 at 7:18 PM, sandp <sandeepred...@gmail.com> wrote:

> Hi,
>  I have a scenario, where I have to first update a row in three  tables,
> then insert a new row into each of those tables. All this should be in a
> single batch of statements and rollback if it fails.
>
> Since, its not possible to specify more than one statementType and or
> executorType  in a camel route, I'm trying to understand if using a *camel
> database transaction * a  recommended way of executing multiple statements
> with the ability to rollback it? or is there  a better way.
>
> *
> Scenario below*
> e.g
> statement1 = update table1;
> statement2= update table2;
> statement3 =update table3;
> statement4 insert into table1;
> statement5 insert into table2;
> statement6 insert into tables3
>
>
> Assuming that statement1 through 6 are mapped a in xml file and considering
> that these cannot be combined into a single statement, how does camel
> mybatis handle the situation i.e run them in a single batch?
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Mybatis-2-13-1-multiple-statementTypes-in-a-batch-or-Transaction-tp5755122.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to