You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Rafael Ponte <rp...@gmail.com> on 2015/04/23 20:29:03 UTC

JPA Component router with read-only transaction

Hi guys,

We're using Camel 2.14.0 with Spring 3.2.11 in our project!

Is it possible to use a JPA Component router just to read entities from
database? We don't need to change or delete the entities loaded through the
router, we already have a specific logic responsible to do that inside our
Spring bean.

My problem is when we set *endpoint.setJoinTransaction(false)* the follow
error happens when JpaConsumer tries to flush the entityManager
instance: *javax.persistence.TransactionRequiredException:
no transaction is in progress*

If we are inside a read-only transaction or even without transaction, this
shouldn't be necessary, right?

-- 
Rafael Ponte
TriadWorks | Formação Java
http://cursos.triadworks.com.br

Re: JPA Component router with read-only transaction

Posted by Rafael Ponte <rp...@gmail.com>.
Hi Claus,

Thanks for your help! But what thread are you talking about?

On Mon, May 11, 2015 at 7:47 AM, Claus Ibsen <cl...@gmail.com> wrote:

> Hi
>
> Have you tried with Camel 2.15.x as there has been some improvements
> to the camel-jpa.
>
> But yeah I would like to see it expaned to run in non-tx mode as well.
> And also make it possible to easier to crud operations and queries as
> well. You can somewhat do this today. But a person on another thread
> had a good idea how to improve this component.
>
> On Thu, Apr 23, 2015 at 8:29 PM, Rafael Ponte <rp...@gmail.com> wrote:
> > Hi guys,
> >
> > We're using Camel 2.14.0 with Spring 3.2.11 in our project!
> >
> > Is it possible to use a JPA Component router just to read entities from
> > database? We don't need to change or delete the entities loaded through
> the
> > router, we already have a specific logic responsible to do that inside
> our
> > Spring bean.
> >
> > My problem is when we set *endpoint.setJoinTransaction(false)* the follow
> > error happens when JpaConsumer tries to flush the entityManager
> > instance: *javax.persistence.TransactionRequiredException:
> > no transaction is in progress*
> >
> > If we are inside a read-only transaction or even without transaction,
> this
> > shouldn't be necessary, right?
> >
> > --
> > Rafael Ponte
> > TriadWorks | Formação Java
> > http://cursos.triadworks.com.br
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>



-- 
Rafael Ponte
TriadWorks | Formação Java
http://cursos.triadworks.com.br

Re: JPA Component router with read-only transaction

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Have you tried with Camel 2.15.x as there has been some improvements
to the camel-jpa.

But yeah I would like to see it expaned to run in non-tx mode as well.
And also make it possible to easier to crud operations and queries as
well. You can somewhat do this today. But a person on another thread
had a good idea how to improve this component.

On Thu, Apr 23, 2015 at 8:29 PM, Rafael Ponte <rp...@gmail.com> wrote:
> Hi guys,
>
> We're using Camel 2.14.0 with Spring 3.2.11 in our project!
>
> Is it possible to use a JPA Component router just to read entities from
> database? We don't need to change or delete the entities loaded through the
> router, we already have a specific logic responsible to do that inside our
> Spring bean.
>
> My problem is when we set *endpoint.setJoinTransaction(false)* the follow
> error happens when JpaConsumer tries to flush the entityManager
> instance: *javax.persistence.TransactionRequiredException:
> no transaction is in progress*
>
> If we are inside a read-only transaction or even without transaction, this
> shouldn't be necessary, right?
>
> --
> Rafael Ponte
> TriadWorks | Formação Java
> http://cursos.triadworks.com.br



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/