You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by yong <yf...@gmail.com> on 2011/04/11 18:21:13 UTC

Is JPA producer transaction safe?

Hi, 

I am using Camel 2.6.   I have a route generating Entity beans through JPA, 
and another route consume these Entity beans through JPA.    The entity bean
has one-to-many relation with some other beans.  (for example, "user" entity
and the "contact" entity".

>From my test,  looks like the JPA consumer start to consume the "user"
entity even before it is fully written to database, ("contact" table only
partially written). 

Is is possible?  or I have to define "transacted()" in my route and will
that be useful?

thanks, 


--
View this message in context: http://camel.465427.n5.nabble.com/Is-JPA-producer-transaction-safe-tp4296297p4296297.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Is JPA producer transaction safe?

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

I think you need to configure the isolation level of the transaction
at the database. Usually you have levels such as READ_COMMITTED, and
what else is there. So do a bit of googling.

On Mon, Apr 11, 2011 at 6:21 PM, yong <yf...@gmail.com> wrote:
> Hi,
>
> I am using Camel 2.6.   I have a route generating Entity beans through JPA,
> and another route consume these Entity beans through JPA.    The entity bean
> has one-to-many relation with some other beans.  (for example, "user" entity
> and the "contact" entity".
>
> From my test,  looks like the JPA consumer start to consume the "user"
> entity even before it is fully written to database, ("contact" table only
> partially written).
>
> Is is possible?  or I have to define "transacted()" in my route and will
> that be useful?
>
> thanks,
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Is-JPA-producer-transaction-safe-tp4296297p4296297.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
CamelOne 2011: http://fusesource.com/camelone2011/
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/