Hi There is a shareUnitOfWork option on the splitter. http://camel.apache.org/splitter
On Thu, Apr 26, 2012 at 8:50 AM, priya <joshipriyadarsh...@gmail.com> wrote: > 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. -- Claus Ibsen ----------------- CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/