Hi,
We are having trouble while maintaining the transactions in a route which
involves unmarshalling of a file and then writing its content into DB.
Route is like:
from( "seda:xyz”)
.transacted()
.onException(Exception.class).maximumRedeliveries(0)
.end()
.split(new SplitterExpression(inputFile))
.streaming()
.stopOnException()
.transform( new Unmarshaller()) .aggregate(aggregationStrategy)
.completionSize(10)
.completionTimeout(2000)
.eagerCheckCompletion()
.to("direct:sub”)
.end()
.end()
.end()
from("direct:sub")
.transacted()
.choice()
.when(condition1).process( new myBean(myDAO))
.when(condition2).process(new myBean1(myDAO))
.end();
// myDAO class deals with insertions and updation of records in DB.
we are able to maintain and rollback JDBC transaction (i.e on any SQL
exception all the DB inserts are rolled back) but
If any exception occurs while unmarshalling the InputFile say if we have 20
records in my file and there is an illegal argument present at 15th record
then I am not able to rollback the entire exchange and DB Insertions happens
for first 14 records present in the input file.
Please tell if there is any way to rollback the complete exchange on file
operation Exception and DB rollback also happens for all the records.
--
View this message in context:
http://camel.465427.n5.nabble.com/Unable-to-rollback-exchange-while-unmarshalling-a-file-tp5666851p5666851.html
Sent from the Camel - Users mailing list archive at Nabble.com.