[
https://issues.apache.org/jira/browse/CAMEL-7269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14316558#comment-14316558
]
abdelgadiri edited comment on CAMEL-7269 at 2/11/15 5:17 PM:
-------------------------------------------------------------
Hi,
I am hitting same issue when upgraded from camel 2.11.x to (2.13.x). Also
failing for me in 2.14.x.
when joinTransaction=true (the default in 2.12.x, 2.13.x and 2.14.x) my route
hangs on below line in JpaConsumer.java class
// commit
LOG.debug("Flushing EntityManager");
entityManager.flush(); (line 137 of JpaConsumer.java class)
when I set joinTransaction=false on the route uri, the route completes fine.
But subsequent polls keep throwing following warning below. Now this may not be
really an issue as it is just a warning but it is filling up my logs and I
wonder if something is wrong.
I am using RESOURCE_LOCAL entitymanager.
2015-02-11 16:49:10.633 [Camel (DefaultCamelContext) thread #0 - jpa://VFile]
WARN o.a.camel.component.jpa.JpaConsumer - Consumer
Consumer[jpa://VFile?consumeDelete=false&consumer.query=select+vf+fro
m+VFile+vf+where+vf.processed%3Dfalse+and+vf.processorId+in+%28%27REPORT_EXPORT%27%29&joinTransaction=false&maximumResults=1]
failed polling endpoint: Endpoint[jpa://VFile?consumeDelete=false&
consumer.query=select+vf+from+VFile+vf+where+vf.processed%3Dfalse+and+vf.processorId+in+%28%27REPORT_EXPORT%27%29&joinTransaction=false&maximumResults=1].
Will try again at next poll. Caused b
y: [javax.persistence.TransactionRequiredException - no transaction is in
progress]
javax.persistence.TransactionRequiredException: no transaction is in progress
at
org.hibernate.jpa.spi.AbstractEntityManagerImpl.checkTransactionNeeded(AbstractEntityManagerImpl.java:1171)
~[hibernate-entitymanager-4.3.8.Final.jar:4.3.8.Final]
at
org.hibernate.jpa.spi.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:1332)
~[hibernate-entitymanager-4.3.8.Final.jar:4.3.8.Final]
at sun.reflect.GeneratedMethodAccessor139.invoke(Unknown Source)
~[na:na]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.7.0_67]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_67]
at
org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:366)
~[spring-orm-3.2.13.RELEASE.jar:3.2.13.RELEASE]
at com.sun.proxy.$Proxy178.flush(Unknown Source) ~[na:na]
at
org.apache.camel.component.jpa.JpaConsumer$1.doInTransaction(JpaConsumer.java:137)
~[camel-jpa-2.13.3.jar:2.13.3]
at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131)
~[spring-tx-3.2.13.RELEASE.jar:3.2.13.RELEASE]
at org.apache.camel.component.jpa.JpaConsumer.poll(JpaConsumer.java:91)
~[camel-jpa-2.13.3.jar:2.13.3]
at
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:187)
[camel-core-2.13.3.jar:2.13.3]
at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:114)
[camel-core-2.13.3.jar:2.13.3]
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
[na:1.7.0_67]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
[na:1.7.0_67]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
[na:1.7.0_67]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
[na:1.7.0_67]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[na:1.7.0_67]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[na:1.7.0_67]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_67]
was (Author: abdelgadiri):
Hi,
I am hitting same issue when upgraded from camel 2.11.x to (2.13.x). Also
failing for me in 2.14.x.
when joinTransaction=true (the default in 2.12.x, 2.13.x and 2.14.x) my route
hangs on below line in JpaConsumer.java class
// commit
LOG.debug("Flushing EntityManager");
entityManager.flush(); (line 137 of JpaConsumer.java class)
when I set joinTransaction=false on the route uri, the route completes fine.
But subsequent polls keep throwing following warning below. Now this may not be
really an issue as it is just a warning but it is filling up my logs and I
wonder if something is wrong
2015-02-11 16:49:10.633 [Camel (DefaultCamelContext) thread #0 - jpa://VFile]
WARN o.a.camel.component.jpa.JpaConsumer - Consumer
Consumer[jpa://VFile?consumeDelete=false&consumer.query=select+vf+fro
m+VFile+vf+where+vf.processed%3Dfalse+and+vf.processorId+in+%28%27REPORT_EXPORT%27%29&joinTransaction=false&maximumResults=1]
failed polling endpoint: Endpoint[jpa://VFile?consumeDelete=false&
consumer.query=select+vf+from+VFile+vf+where+vf.processed%3Dfalse+and+vf.processorId+in+%28%27REPORT_EXPORT%27%29&joinTransaction=false&maximumResults=1].
Will try again at next poll. Caused b
y: [javax.persistence.TransactionRequiredException - no transaction is in
progress]
javax.persistence.TransactionRequiredException: no transaction is in progress
at
org.hibernate.jpa.spi.AbstractEntityManagerImpl.checkTransactionNeeded(AbstractEntityManagerImpl.java:1171)
~[hibernate-entitymanager-4.3.8.Final.jar:4.3.8.Final]
at
org.hibernate.jpa.spi.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:1332)
~[hibernate-entitymanager-4.3.8.Final.jar:4.3.8.Final]
at sun.reflect.GeneratedMethodAccessor139.invoke(Unknown Source)
~[na:na]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.7.0_67]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_67]
at
org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:366)
~[spring-orm-3.2.13.RELEASE.jar:3.2.13.RELEASE]
at com.sun.proxy.$Proxy178.flush(Unknown Source) ~[na:na]
at
org.apache.camel.component.jpa.JpaConsumer$1.doInTransaction(JpaConsumer.java:137)
~[camel-jpa-2.13.3.jar:2.13.3]
at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131)
~[spring-tx-3.2.13.RELEASE.jar:3.2.13.RELEASE]
at org.apache.camel.component.jpa.JpaConsumer.poll(JpaConsumer.java:91)
~[camel-jpa-2.13.3.jar:2.13.3]
at
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:187)
[camel-core-2.13.3.jar:2.13.3]
at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:114)
[camel-core-2.13.3.jar:2.13.3]
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
[na:1.7.0_67]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
[na:1.7.0_67]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
[na:1.7.0_67]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
[na:1.7.0_67]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[na:1.7.0_67]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[na:1.7.0_67]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_67]
> camel-jpa - joinTransaction called for RESOURCE_LOCAL datasource
> ----------------------------------------------------------------
>
> Key: CAMEL-7269
> URL: https://issues.apache.org/jira/browse/CAMEL-7269
> Project: Camel
> Issue Type: Bug
> Components: camel-jpa
> Affects Versions: 2.12.0
> Environment: tomcat+eclipselink+camel 2.12.2
> Reporter: Hristo Sabev
> Assignee: Grzegorz Grzybek
> Fix For: Future
>
>
> At line 82, JpaConsumer calls entityManager.joinTransaction(). This call
> cannot really work in environmnent without JTA. This is a change since 2.11.x
> and earlier versions where non JTA environments were supported
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)