On Tue, Nov 15, 2011 at 6:59 PM, Preben.Asmussen <p...@dr.dk> wrote: > @Claus > Just had a look at commit > http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java?p2=%2Fcamel%2Ftrunk%2Fcomponents%2Fcamel-jpa%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fcamel%2Fcomponent%2Fjpa%2FJpaConsumer.java&p1=%2Fcamel%2Ftrunk%2Fcomponents%2Fcamel-jpa%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fcamel%2Fcomponent%2Fjpa%2FJpaConsumer.java&r1=1202215&r2=1202214&view=diff&pathrev=1202215 > > Is this gonna work ? flush != commit. If you have 2 tx resources (table + > jms queue) and a txmanager, the txmanager is in charge of commit or > rollback. >
You would configure the JPA component to use the TX manager. And it initiate a TX unit of work from the JpaConsumer, which is essentially the code we do in the doInJpa method. So by not throwing a PersistenceException in the doInJpa method you instruct the TX manager to commit. > I would guess that that all still will be rolled back even with em.flush, or > have I missed something. > > Preben > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4995161.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen ----------------- 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/