You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Preben.Asmussen" <pr...@dr.dk> on 2011/11/03 10:00:17 UTC
Misleading jmx statistics on jpa component
Im using the jpa component as a consumer to poll a table. The batchsize of
each poll is set to eg. 100 as :
<from uri="jpa:org.apache.camel.MyEntity?consumer.query=select x from
org.apache.MyEntity x order by
sekvens&maximumResults=100&consumeLockEntity=false" />
<transacted/>
The route is transacted so at the end the whole batch is either successful,
or gets rolled back i there is a problem with any of the records read.
It works nicely - the problem is that the jmx statistics on the route logs
each exchange as completed even though at the end everything might get
rolled back. In my opinion they should be regarded as failed instead. ?
Camel version 2.8.1
/preben
--
View this message in context: http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4960503.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Fuse Apache Camel High Availability ...
Posted by Christian Schneider <ch...@die-schneider.net>.
Your requirements sound similar to havign a cluster of two webservers
which is quite common.
Mina directly listens on a port. So you need an additional loadbalancer
in front of the two servers that forwards the requests to them.
I suggest to use one of the proven hardware solutions for this.
Another solution would be to use a unix cluster software. In that case
the Active Server would listen to the cluster ip address and in the
failover case the passive server would activate and take over this ip
address.
I think Camel has no built in mechanism that could handle this alone. If
used with one of the above solutions you probably do not have to do
anything special in camel.
Christian
Am 04.11.2011 11:08, schrieb Omar Atia:
> Dear Christian,
>
> I'm using apache camel 2.8.0 .
>
> The following scenario , I'm handling synchronous responses for provisioning server Inout.
>
> These interfaces are TCP server MINA , the receive requests and calls web service using CXF and POJO format .
>
> 4 MINA routes will be up when running mvn camel:run .
>
> Can we put apache camel on two servers and handle the requests between them ? and also how to Add enough memory as I have 32 concurrent connection to apache MINA as well.
>
> I believe below you mean using apache activemq with high availability solution so I have explained to you the main integration above ? what is your recommendation ?
>
> Thanks,
> Omar
>
> -----Original Message-----
> From: Christian Schneider [mailto:cschneider111@googlemail.com] On Behalf Of Christian Schneider
> Sent: Friday, November 04, 2011 11:53 AM
> To: users@camel.apache.org
> Subject: Re: Fuse Apache Camel High Availability ...
>
> Hi Omar,
>
> what is Fuse Apache Camel? Do you mean Apache Camel or the Fuse Distro?
> I can sure help with Apache Camel.
>
> There is no general solution for High Availability but many best
> practices. It depends a lot on what your requirements are. Generally
> JMS offers good HA features.
> For example you can have two consumers on a route that load balance.
>
> It is also important if your messages have to be kept in sequence or
> not. Can you describe how your integration looks like?
>
> Christian
>
>
> Am 04.11.2011 09:59, schrieb Omar Atia:
>> Dears,
>>
>> I would like to investigate on high availability based on Fuse Apache Camel 2.8.0 , CXF and Spring , it is already deployed on one Unix machine and I'm planning to deploy it 2nd Unix machine and need to configure another server to design high available solution , what is your recommendation for that ?
>>
>> Thanks,
>> Omar Atia
>>
>>
>
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
Talend Application Integration Division http://www.talend.com
RE: Fuse Apache Camel High Availability ...
Posted by Omar Atia <om...@its.ws>.
Dear Christian,
I'm using apache camel 2.8.0 .
The following scenario , I'm handling synchronous responses for provisioning server Inout.
These interfaces are TCP server MINA , the receive requests and calls web service using CXF and POJO format .
4 MINA routes will be up when running mvn camel:run .
Can we put apache camel on two servers and handle the requests between them ? and also how to Add enough memory as I have 32 concurrent connection to apache MINA as well.
I believe below you mean using apache activemq with high availability solution so I have explained to you the main integration above ? what is your recommendation ?
Thanks,
Omar
-----Original Message-----
From: Christian Schneider [mailto:cschneider111@googlemail.com] On Behalf Of Christian Schneider
Sent: Friday, November 04, 2011 11:53 AM
To: users@camel.apache.org
Subject: Re: Fuse Apache Camel High Availability ...
Hi Omar,
what is Fuse Apache Camel? Do you mean Apache Camel or the Fuse Distro?
I can sure help with Apache Camel.
There is no general solution for High Availability but many best
practices. It depends a lot on what your requirements are. Generally
JMS offers good HA features.
For example you can have two consumers on a route that load balance.
It is also important if your messages have to be kept in sequence or
not. Can you describe how your integration looks like?
Christian
Am 04.11.2011 09:59, schrieb Omar Atia:
> Dears,
>
> I would like to investigate on high availability based on Fuse Apache Camel 2.8.0 , CXF and Spring , it is already deployed on one Unix machine and I'm planning to deploy it 2nd Unix machine and need to configure another server to design high available solution , what is your recommendation for that ?
>
> Thanks,
> Omar Atia
>
>
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
Talend Application Integration Division http://www.talend.com
Re: Fuse Apache Camel High Availability ...
Posted by Christian Schneider <ch...@die-schneider.net>.
Hi Omar,
what is Fuse Apache Camel? Do you mean Apache Camel or the Fuse Distro?
I can sure help with Apache Camel.
There is no general solution for High Availability but many best
practices. It depends a lot on what your requirements are. Generally
JMS offers good HA features.
For example you can have two consumers on a route that load balance.
It is also important if your messages have to be kept in sequence or
not. Can you describe how your integration looks like?
Christian
Am 04.11.2011 09:59, schrieb Omar Atia:
> Dears,
>
> I would like to investigate on high availability based on Fuse Apache Camel 2.8.0 , CXF and Spring , it is already deployed on one Unix machine and I'm planning to deploy it 2nd Unix machine and need to configure another server to design high available solution , what is your recommendation for that ?
>
> Thanks,
> Omar Atia
>
>
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
Talend Application Integration Division http://www.talend.com
RE: Fuse Apache Camel High Availability ...
Posted by Omar Atia <om...@its.ws>.
Dears,
I would like to investigate on high availability based on Fuse Apache Camel 2.8.0 , CXF and Spring , it is already deployed on one Unix machine and I'm planning to deploy it 2nd Unix machine and need to configure another server to design high available solution , what is your recommendation for that ?
Thanks,
Omar Atia
Re: Misleading jmx statistics on jpa component
Posted by Christian Schneider <ch...@die-schneider.net>.
Yes I think that would help. Preben also suggested that it might be a
good idea to commit all rows before the exception so the one with the
error is the first one that fails next time. This avoids that you have
to retry all good records every time.
This may be a bit more difficult to achieve though.
Christian
Am 04.11.2011 11:00, schrieb Claus Ibsen:
> On Fri, Nov 4, 2011 at 10:57 AM, Christian Schneider
> <ch...@die-schneider.net> wrote:
>> Well so it is code in spring that tries to commit. Still I would rather
>> expect that the transaction should be rolled back.
>>
> Spring TX is weird. Even if you mark the TX for rollback only, it may
> still commit it.
> The solution is to throw a runtime exception in the doInTransaciton
> method, like we do in the Camel TransactionErrorHandler.
> That's possible what is missing in the camel-jpa, which possible have
> a doInTransaction method or something like that.
>
>
>
>> Christian
>>
>> Am 04.11.2011 10:24, schrieb bvahdat:
>>> Hi Christian,
>>>
>>> IMHO one can easily see that it's not camel trying to commit the
>>> transaction
>>> (in contrast to what you claimed) but the current spring
>>> PlatformTransactionManager in charge, in this given case it's spring
>>> JpaTransactionManager, the relevant part by the stacktrace is:
>>>
>>> ...
>>> at
>>>
>>> org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
>>> at
>>>
>>> org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
>>> at
>>>
>>> org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:147)
>>> ...
>>>
>>> In contrary camel's TransactionErrorHandler.processInTransaction() clearly
>>> warns about the current transaction getting rolled back:
>>>
>>> ...
>>> [rip.adapters.rap.PublicationIn] TransactionErrorHandler WARN
>>> Transaction rollback (0x5113f0) for ExchangeId:
>>> ID-W14523-2657-1320391149162-0-141
>>> ...
>>>
>>> On the other hand there's not much I can say regarding the misleading jmx
>>> statistics but as far as I remember there was some added support for the
>>> JMX-notifications introduced in:
>>>
>>> https://issues.apache.org/jira/browse/CAMEL-4516
>>>
>>> @Omar Atia: I think you're in the wrong chat-room ;-)
>>>
>>> Regards, Babak
>>>
>>>
>>> --
>>> View this message in context:
>>> http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4963451.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>> --
>> Christian Schneider
>> http://www.liquid-reality.de
>>
>> Open Source Architect
>> Talend Application Integration Division http://www.talend.com
>>
>>
>
>
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
Talend Application Integration Division http://www.talend.com
Re: Misleading jmx statistics on jpa component
Posted by bvahdat <ba...@swissonline.ch>.
@Claus,
That's for sure may be not correct, but it's how I see it:
To my understanding in the sense of the CRUD operation one can C, U or D an
entity through the JpaProducer, however
only R through a JpaConsumer, so don't get the point why JpaConsumer should
do entityManager.flush() at all, for
example while polling! Other than that I don't think that calling
entityManager.flush() could help in any way in
the case the JPA-Provider throws PersistenceException in JpaConsumer.poll()
and that gets just swallowed & flush()
gets called afterwards. To me that PersistenceException would mean that some
serious problems on the DB occured while
reading through a JPA or Native Query on the JpaConsumer from which we could
ever/never recover ourself:
PersistenceException cause = null;
int messagePolled = 0;
try {
messagePolled = processBatch(CastUtils.cast(answer));
} catch (Exception e) {
if (e instanceof PersistenceException) {
cause = (PersistenceException) e;
} else {
cause = new PersistenceException(e);
}
}
if (cause != null) {
if (!isTransacted()) {
LOG.warn("Error processing last message due: {}.
Will commit all previous successful processed message, and ignore this last
failure.", cause.getMessage(), cause);
entityManager.flush();
} else {
// rollback all by throwning exception
throw cause;
}
}
In the sense of the expected ACID properties I think having that
consumer.transacted default to false would violate the A (all or nothing).
Maybe true would be better. Again that's just my 2 cents which may be not
correct at all.
Thanks, Babak
--
View this message in context: http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4994753.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Misleading jmx statistics on jpa component
Posted by bvahdat <ba...@swissonline.ch>.
Yeah, that's exactly what I also doubted in my previous Post.
--
View this message in context: http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4995364.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Misleading jmx statistics on jpa component
Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Nov 15, 2011 at 6:59 PM, Preben.Asmussen <pr...@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: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
Re: Misleading jmx statistics on jpa component
Posted by "Preben.Asmussen" <pr...@dr.dk>.
@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.
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.
Re: Misleading jmx statistics on jpa component
Posted by bvahdat <ba...@swissonline.ch>.
Hi Claus,
just saw your proposal and would like to share my idea as well but please
let me get back to you today afternoon (UTC/GMT +1 hour)
in the meanwhile in the case you would have some spare time (which I doubt
:-)) I would really appreciate if you would take a look at [1] to see if I
advised Tarjei wrong as I aim not to irritate camel users (like myself) by
giving some wrong informations/ideas. So if you think I'm wrong there then
please share your feedback in that thread. According to Tarjei you advised
him to create ticket [2] and by that ticket I proposed him to close it,
which indeed he did.
Thanks, Babak
[1]
http://camel.465427.n5.nabble.com/NPE-when-using-SEDA-queue-tp4973626p4992840.html
[2] https://issues.apache.org/jira/browse/CAMEL-4650
--
View this message in context: http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4993946.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Misleading jmx statistics on jpa component
Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Nov 16, 2011 at 10:37 AM, Claus Ibsen <cl...@gmail.com> wrote:
> On Tue, Nov 15, 2011 at 4:52 PM, Preben.Asmussen <pr...@dr.dk> wrote:
>> @Claus
>>
>> +1 This would be really helpfull.
>>
>> In addition to the problem you laid out I can tell that consuming 100 rows
>> -> processing the 70 building a xml payload -> put in on a jms queue and
>> then on the 71 have an error that rolles everything back ultimately can fill
>> up the redolog off the db and bring it to it's knees.
>> Because of this we only consume one record at the time + have a onException
>> handler with backoff.
>>
>
> Yeah I would suggest to pickup only 1 row at the time if you want to
> enforce transactional integrity,
> when multiple TX resources is involved such as JPA + JMS.
>
> Or at least limit the number of messages to pickup, to a reasonable
> size, to avoid the number of participating messages in the TX gets too
> big, as well the memory consumption needed would be bigger etc.
>
> Of course if speed is important, then you may be able to find a
> reasonable batch size.
>
Oh if you have multiple TX resources participating, such as
from JPA
to bean A
to JMS
Where JPA + JMS participate, then you should consider using
transacted=true on the JPA consumer, if you pickup 2+ or more rows in
the same TX from the JPA consumer.
Now imagine that there is 5 rows being picked up from the JPA
consumer. Each row will get processed as a new Exchange in the Camel
route, and thus send to a JMS destination. Now imagine the first 3
Exchange is processed successfully. However the 4th Exchange fails
with an exception from the bean. The exception is propagated back the
JPA consumer, which initiate a full rollback on the TX. So all 5 rows
is kept in the database, as well the 3 messages sent to the JMS queue
is not committed either.
Now you could argue that any previous successfully messages should
commit, and only the last message should rollback. So we can do this
by setting consumer.transacted=false on the JPA consumer. The reason
for this is that we regard all previous work before the exception as
successful.
So in this example if consumer.transacted=true, then the 3 rows will
get commited as well the 3 JMS messages. The JPA consumer will when
committing a row, delete the row by default (you can adjust this
behavior). So on the next JPA poll, then the JpaConsumer will only
find the 2 rows (as the first 3 was committed).
However the game plan changes if you do work in the Camel route after
sending to the JMS queue.
from JPA
to bean A
to JMS
to bean B
Now imagine that we pickup again 5 rows, the first 3 rows are
processed succesfully. Now the 4th row fails, but this time in the
bean B step; *after* sending to JMS. So if we have
consumer.transacted=false, then it would regard all previous work
*before* the exception as successful, and issue a commit. And ignore
the last exception. So in this case the commit will commit the 3 rows
in the database, by deleting the 3 rows, and send the 3+1 messages to
the JMS queue. Here is the problem, we end up sending that 4th message
to the JMS queue.
To remedy this you would need to use consumer.transacted=true, to
enforce rolling back all together.
And thus you may want to only pickup 1 message at a time from the JPA
consumer, and only have 1 message per TX. Then you would be able to
commit the 3 first rows. And only rollback on that 4th row.
>
>
>> preben
>>
>>
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4994706.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
Re: Misleading jmx statistics on jpa component
Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Nov 15, 2011 at 4:52 PM, Preben.Asmussen <pr...@dr.dk> wrote:
> @Claus
>
> +1 This would be really helpfull.
>
> In addition to the problem you laid out I can tell that consuming 100 rows
> -> processing the 70 building a xml payload -> put in on a jms queue and
> then on the 71 have an error that rolles everything back ultimately can fill
> up the redolog off the db and bring it to it's knees.
> Because of this we only consume one record at the time + have a onException
> handler with backoff.
>
Yeah I would suggest to pickup only 1 row at the time if you want to
enforce transactional integrity,
when multiple TX resources is involved such as JPA + JMS.
Or at least limit the number of messages to pickup, to a reasonable
size, to avoid the number of participating messages in the TX gets too
big, as well the memory consumption needed would be bigger etc.
Of course if speed is important, then you may be able to find a
reasonable batch size.
> preben
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4994706.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
Re: Misleading jmx statistics on jpa component
Posted by "Preben.Asmussen" <pr...@dr.dk>.
@Claus
+1 This would be really helpfull.
In addition to the problem you laid out I can tell that consuming 100 rows
-> processing the 70 building a xml payload -> put in on a jms queue and
then on the 71 have an error that rolles everything back ultimately can fill
up the redolog off the db and bring it to it's knees.
Because of this we only consume one record at the time + have a onException
handler with backoff.
preben
--
View this message in context: http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4994706.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Misleading jmx statistics on jpa component
Posted by bvahdat <ba...@swissonline.ch>.
@Claus,
could you also please take a quick look at my comment on the ticket as well:
https://issues.apache.org/jira/browse/CAMEL-4668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13149180#comment-13149180
Thanks, Babak
--
View this message in context: http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4987767.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Misleading jmx statistics on jpa component
Posted by Achim Nierbeck <bc...@googlemail.com>.
Claus,
cool thanx :)
regards, Achim
2011/11/15 Claus Ibsen <cl...@gmail.com>
> On Tue, Nov 15, 2011 at 11:05 AM, Claus Ibsen <cl...@gmail.com>
> wrote:
> > On Tue, Nov 15, 2011 at 11:02 AM, Achim Nierbeck
> > <bc...@googlemail.com> wrote:
> >> Hi Clause,
> >>
> >> even though I'm fully with you that this sounds reasonable I would like
> to
> >> see this
> >> feature/improvement optional or at least being able to be disabled since
> >> right now
> >> I'm actually using this feature of a complete rollback of all changes
> done,
> >> because one of the
> >> incoming messages is "corrupt" :)
> >>
> >
> > Yeah we could add an option to control this. And then in your case,
> > you can enable this option.
> > I wonder what a good option name would be?
>
> There is now a consumer.transacted option you can use to control this.
> https://issues.apache.org/jira/browse/CAMEL-4683
>
> Achim in your case, you can set that option to true, to have the
> behavior you asked about.
> The default is false, to commit all the previous good messages.
>
>
>
> >
> >
> >> Regards, Achim
> >>
> >> 2011/11/15 Claus Ibsen <cl...@gmail.com>
> >>
> >>> Hi
> >>>
> >>> The JPA consumer is a bit special as its consuming messages from a
> >>> database, as they were from a JMS queue.
> >>> So its basically a queue based solution on a database table.
> >>>
> >>> So I frankly think we should alter the concept of transaction, as IMHO
> >>> it does not make sense to consume X number of rows from a datase table
> >>> and have them all act in the same transaction. The reason is the JPA
> >>> consumer is scheduled based, and will pick up X rows which is
> >>> currently in the table. (basically a SELECT * form MY_TABLE).
> >>>
> >>> I think the behavior should be changed to
> >>> - on first exception, commit the previous good messages
> >>> - break out, and log a WARN that the current message could not be
> processed
> >>>
> >>> Then upon next poll from the JPA consumer, all the previous good
> >>> messages was committed, and it will only pickup the previous bad row
> >>> (+ any additional new rows).
> >>>
> >>>
> >>> With the current behavior you can end up with a situation like
> >>> 1) There is 100 rows in the table
> >>> 2) JPA consumer pickup a ResultSet with 100 rows. And will process
> >>> each row one by one.
> >>> 3) Now after processing 69 messages, number 70th fails.
> >>> 4) All 100 rows will rollback
> >>> 5) JPA consumer is scheduled again, and pickup yet again a ResultSet
> >>> with 100 rows. And will process each row one by one.
> >>> 6) Now after processing 69 messages (the same 69 messages from
> >>> previous poll), number 70th fails yet again.
> >>> 7) All 100 rows will rollback
> >>> ... and it will repeat itself.
> >>>
> >>> What I propose is to change the behavior to (which you could argue the
> >>> old situation was, albeit there was a bug, causing to commit
> >>> regardless what, and not break out if there was an unhandled
> >>> exception)
> >>> 1) There is 100 rows in the table
> >>> 2) JPA consumer pickup a ResultSet with 100 rows. And will process
> >>> each row one by one.
> >>> 3) Now after processing 69 messages, number 70th fails.
> >>> 4) The 69 good rows will commit
> >>> 5) A WARN is logged about the failure of processing the 70th message
> >>> 6) JPA consumer is scheduled again, and pickup a new ResultSet with 41
> >>> rows. And will process each row one by one.
> >>> 7) Now processing the 1st message fails, because on last poll that
> >>> message failed as well
> >>> 8) There is no good messages to commit
> >>> 9) A WARN is logged about the failure of processing the 1th message
> >>> ... and it will repeat itself.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> Claus Ibsen
> >>> -----------------
> >>> FuseSource
> >>> Email: cibsen@fusesource.com
> >>> Web: http://fusesource.com
> >>> Twitter: davsclaus, fusenews
> >>> Blog: http://davsclaus.blogspot.com/
> >>> Author of Camel in Action: http://www.manning.com/ibsen/
> >>>
> >>
> >>
> >>
> >> --
> >> *Achim Nierbeck*
> >>
> >> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> >> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
> Committer &
> >> Project Lead
> >> blog <http://notizblog.nierbeck.de/>
> >>
> >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > FuseSource
> > Email: cibsen@fusesource.com
> > Web: http://fusesource.com
> > Twitter: davsclaus, fusenews
> > Blog: http://davsclaus.blogspot.com/
> > Author of Camel in Action: http://www.manning.com/ibsen/
> >
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>
--
*Achim Nierbeck*
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Re: Misleading jmx statistics on jpa component
Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Nov 15, 2011 at 11:05 AM, Claus Ibsen <cl...@gmail.com> wrote:
> On Tue, Nov 15, 2011 at 11:02 AM, Achim Nierbeck
> <bc...@googlemail.com> wrote:
>> Hi Clause,
>>
>> even though I'm fully with you that this sounds reasonable I would like to
>> see this
>> feature/improvement optional or at least being able to be disabled since
>> right now
>> I'm actually using this feature of a complete rollback of all changes done,
>> because one of the
>> incoming messages is "corrupt" :)
>>
>
> Yeah we could add an option to control this. And then in your case,
> you can enable this option.
> I wonder what a good option name would be?
There is now a consumer.transacted option you can use to control this.
https://issues.apache.org/jira/browse/CAMEL-4683
Achim in your case, you can set that option to true, to have the
behavior you asked about.
The default is false, to commit all the previous good messages.
>
>
>> Regards, Achim
>>
>> 2011/11/15 Claus Ibsen <cl...@gmail.com>
>>
>>> Hi
>>>
>>> The JPA consumer is a bit special as its consuming messages from a
>>> database, as they were from a JMS queue.
>>> So its basically a queue based solution on a database table.
>>>
>>> So I frankly think we should alter the concept of transaction, as IMHO
>>> it does not make sense to consume X number of rows from a datase table
>>> and have them all act in the same transaction. The reason is the JPA
>>> consumer is scheduled based, and will pick up X rows which is
>>> currently in the table. (basically a SELECT * form MY_TABLE).
>>>
>>> I think the behavior should be changed to
>>> - on first exception, commit the previous good messages
>>> - break out, and log a WARN that the current message could not be processed
>>>
>>> Then upon next poll from the JPA consumer, all the previous good
>>> messages was committed, and it will only pickup the previous bad row
>>> (+ any additional new rows).
>>>
>>>
>>> With the current behavior you can end up with a situation like
>>> 1) There is 100 rows in the table
>>> 2) JPA consumer pickup a ResultSet with 100 rows. And will process
>>> each row one by one.
>>> 3) Now after processing 69 messages, number 70th fails.
>>> 4) All 100 rows will rollback
>>> 5) JPA consumer is scheduled again, and pickup yet again a ResultSet
>>> with 100 rows. And will process each row one by one.
>>> 6) Now after processing 69 messages (the same 69 messages from
>>> previous poll), number 70th fails yet again.
>>> 7) All 100 rows will rollback
>>> ... and it will repeat itself.
>>>
>>> What I propose is to change the behavior to (which you could argue the
>>> old situation was, albeit there was a bug, causing to commit
>>> regardless what, and not break out if there was an unhandled
>>> exception)
>>> 1) There is 100 rows in the table
>>> 2) JPA consumer pickup a ResultSet with 100 rows. And will process
>>> each row one by one.
>>> 3) Now after processing 69 messages, number 70th fails.
>>> 4) The 69 good rows will commit
>>> 5) A WARN is logged about the failure of processing the 70th message
>>> 6) JPA consumer is scheduled again, and pickup a new ResultSet with 41
>>> rows. And will process each row one by one.
>>> 7) Now processing the 1st message fails, because on last poll that
>>> message failed as well
>>> 8) There is no good messages to commit
>>> 9) A WARN is logged about the failure of processing the 1th message
>>> ... and it will repeat itself.
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> -----------------
>>> FuseSource
>>> Email: cibsen@fusesource.com
>>> Web: http://fusesource.com
>>> Twitter: davsclaus, fusenews
>>> Blog: http://davsclaus.blogspot.com/
>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>
>>
>>
>>
>> --
>> *Achim Nierbeck*
>>
>> Apache Karaf <http://karaf.apache.org/> Committer & PMC
>> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
>> Project Lead
>> blog <http://notizblog.nierbeck.de/>
>>
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
Re: Misleading jmx statistics on jpa component
Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Nov 15, 2011 at 11:02 AM, Achim Nierbeck
<bc...@googlemail.com> wrote:
> Hi Clause,
>
> even though I'm fully with you that this sounds reasonable I would like to
> see this
> feature/improvement optional or at least being able to be disabled since
> right now
> I'm actually using this feature of a complete rollback of all changes done,
> because one of the
> incoming messages is "corrupt" :)
>
Yeah we could add an option to control this. And then in your case,
you can enable this option.
I wonder what a good option name would be?
> Regards, Achim
>
> 2011/11/15 Claus Ibsen <cl...@gmail.com>
>
>> Hi
>>
>> The JPA consumer is a bit special as its consuming messages from a
>> database, as they were from a JMS queue.
>> So its basically a queue based solution on a database table.
>>
>> So I frankly think we should alter the concept of transaction, as IMHO
>> it does not make sense to consume X number of rows from a datase table
>> and have them all act in the same transaction. The reason is the JPA
>> consumer is scheduled based, and will pick up X rows which is
>> currently in the table. (basically a SELECT * form MY_TABLE).
>>
>> I think the behavior should be changed to
>> - on first exception, commit the previous good messages
>> - break out, and log a WARN that the current message could not be processed
>>
>> Then upon next poll from the JPA consumer, all the previous good
>> messages was committed, and it will only pickup the previous bad row
>> (+ any additional new rows).
>>
>>
>> With the current behavior you can end up with a situation like
>> 1) There is 100 rows in the table
>> 2) JPA consumer pickup a ResultSet with 100 rows. And will process
>> each row one by one.
>> 3) Now after processing 69 messages, number 70th fails.
>> 4) All 100 rows will rollback
>> 5) JPA consumer is scheduled again, and pickup yet again a ResultSet
>> with 100 rows. And will process each row one by one.
>> 6) Now after processing 69 messages (the same 69 messages from
>> previous poll), number 70th fails yet again.
>> 7) All 100 rows will rollback
>> ... and it will repeat itself.
>>
>> What I propose is to change the behavior to (which you could argue the
>> old situation was, albeit there was a bug, causing to commit
>> regardless what, and not break out if there was an unhandled
>> exception)
>> 1) There is 100 rows in the table
>> 2) JPA consumer pickup a ResultSet with 100 rows. And will process
>> each row one by one.
>> 3) Now after processing 69 messages, number 70th fails.
>> 4) The 69 good rows will commit
>> 5) A WARN is logged about the failure of processing the 70th message
>> 6) JPA consumer is scheduled again, and pickup a new ResultSet with 41
>> rows. And will process each row one by one.
>> 7) Now processing the 1st message fails, because on last poll that
>> message failed as well
>> 8) There is no good messages to commit
>> 9) A WARN is logged about the failure of processing the 1th message
>> ... and it will repeat itself.
>>
>>
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> FuseSource
>> Email: cibsen@fusesource.com
>> Web: http://fusesource.com
>> Twitter: davsclaus, fusenews
>> Blog: http://davsclaus.blogspot.com/
>> Author of Camel in Action: http://www.manning.com/ibsen/
>>
>
>
>
> --
> *Achim Nierbeck*
>
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
> Project Lead
> blog <http://notizblog.nierbeck.de/>
>
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
Re: Misleading jmx statistics on jpa component
Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi Clause,
even though I'm fully with you that this sounds reasonable I would like to
see this
feature/improvement optional or at least being able to be disabled since
right now
I'm actually using this feature of a complete rollback of all changes done,
because one of the
incoming messages is "corrupt" :)
Regards, Achim
2011/11/15 Claus Ibsen <cl...@gmail.com>
> Hi
>
> The JPA consumer is a bit special as its consuming messages from a
> database, as they were from a JMS queue.
> So its basically a queue based solution on a database table.
>
> So I frankly think we should alter the concept of transaction, as IMHO
> it does not make sense to consume X number of rows from a datase table
> and have them all act in the same transaction. The reason is the JPA
> consumer is scheduled based, and will pick up X rows which is
> currently in the table. (basically a SELECT * form MY_TABLE).
>
> I think the behavior should be changed to
> - on first exception, commit the previous good messages
> - break out, and log a WARN that the current message could not be processed
>
> Then upon next poll from the JPA consumer, all the previous good
> messages was committed, and it will only pickup the previous bad row
> (+ any additional new rows).
>
>
> With the current behavior you can end up with a situation like
> 1) There is 100 rows in the table
> 2) JPA consumer pickup a ResultSet with 100 rows. And will process
> each row one by one.
> 3) Now after processing 69 messages, number 70th fails.
> 4) All 100 rows will rollback
> 5) JPA consumer is scheduled again, and pickup yet again a ResultSet
> with 100 rows. And will process each row one by one.
> 6) Now after processing 69 messages (the same 69 messages from
> previous poll), number 70th fails yet again.
> 7) All 100 rows will rollback
> ... and it will repeat itself.
>
> What I propose is to change the behavior to (which you could argue the
> old situation was, albeit there was a bug, causing to commit
> regardless what, and not break out if there was an unhandled
> exception)
> 1) There is 100 rows in the table
> 2) JPA consumer pickup a ResultSet with 100 rows. And will process
> each row one by one.
> 3) Now after processing 69 messages, number 70th fails.
> 4) The 69 good rows will commit
> 5) A WARN is logged about the failure of processing the 70th message
> 6) JPA consumer is scheduled again, and pickup a new ResultSet with 41
> rows. And will process each row one by one.
> 7) Now processing the 1st message fails, because on last poll that
> message failed as well
> 8) There is no good messages to commit
> 9) A WARN is logged about the failure of processing the 1th message
> ... and it will repeat itself.
>
>
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>
--
*Achim Nierbeck*
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Re: Misleading jmx statistics on jpa component
Posted by Christian Schneider <ch...@die-schneider.net>.
+1
That sounds good
Christian
Am 15.11.2011 10:26, schrieb Claus Ibsen:
> Hi
>
> The JPA consumer is a bit special as its consuming messages from a
> database, as they were from a JMS queue.
> So its basically a queue based solution on a database table.
>
> So I frankly think we should alter the concept of transaction, as IMHO
> it does not make sense to consume X number of rows from a datase table
> and have them all act in the same transaction. The reason is the JPA
> consumer is scheduled based, and will pick up X rows which is
> currently in the table. (basically a SELECT * form MY_TABLE).
>
> I think the behavior should be changed to
> - on first exception, commit the previous good messages
> - break out, and log a WARN that the current message could not be processed
>
> Then upon next poll from the JPA consumer, all the previous good
> messages was committed, and it will only pickup the previous bad row
> (+ any additional new rows).
>
>
> With the current behavior you can end up with a situation like
> 1) There is 100 rows in the table
> 2) JPA consumer pickup a ResultSet with 100 rows. And will process
> each row one by one.
> 3) Now after processing 69 messages, number 70th fails.
> 4) All 100 rows will rollback
> 5) JPA consumer is scheduled again, and pickup yet again a ResultSet
> with 100 rows. And will process each row one by one.
> 6) Now after processing 69 messages (the same 69 messages from
> previous poll), number 70th fails yet again.
> 7) All 100 rows will rollback
> ... and it will repeat itself.
>
> What I propose is to change the behavior to (which you could argue the
> old situation was, albeit there was a bug, causing to commit
> regardless what, and not break out if there was an unhandled
> exception)
> 1) There is 100 rows in the table
> 2) JPA consumer pickup a ResultSet with 100 rows. And will process
> each row one by one.
> 3) Now after processing 69 messages, number 70th fails.
> 4) The 69 good rows will commit
> 5) A WARN is logged about the failure of processing the 70th message
> 6) JPA consumer is scheduled again, and pickup a new ResultSet with 41
> rows. And will process each row one by one.
> 7) Now processing the 1st message fails, because on last poll that
> message failed as well
> 8) There is no good messages to commit
> 9) A WARN is logged about the failure of processing the 1th message
> ... and it will repeat itself.
>
>
>
>
>
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
Talend Application Integration Division http://www.talend.com
Re: Misleading jmx statistics on jpa component
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
The JPA consumer is a bit special as its consuming messages from a
database, as they were from a JMS queue.
So its basically a queue based solution on a database table.
So I frankly think we should alter the concept of transaction, as IMHO
it does not make sense to consume X number of rows from a datase table
and have them all act in the same transaction. The reason is the JPA
consumer is scheduled based, and will pick up X rows which is
currently in the table. (basically a SELECT * form MY_TABLE).
I think the behavior should be changed to
- on first exception, commit the previous good messages
- break out, and log a WARN that the current message could not be processed
Then upon next poll from the JPA consumer, all the previous good
messages was committed, and it will only pickup the previous bad row
(+ any additional new rows).
With the current behavior you can end up with a situation like
1) There is 100 rows in the table
2) JPA consumer pickup a ResultSet with 100 rows. And will process
each row one by one.
3) Now after processing 69 messages, number 70th fails.
4) All 100 rows will rollback
5) JPA consumer is scheduled again, and pickup yet again a ResultSet
with 100 rows. And will process each row one by one.
6) Now after processing 69 messages (the same 69 messages from
previous poll), number 70th fails yet again.
7) All 100 rows will rollback
... and it will repeat itself.
What I propose is to change the behavior to (which you could argue the
old situation was, albeit there was a bug, causing to commit
regardless what, and not break out if there was an unhandled
exception)
1) There is 100 rows in the table
2) JPA consumer pickup a ResultSet with 100 rows. And will process
each row one by one.
3) Now after processing 69 messages, number 70th fails.
4) The 69 good rows will commit
5) A WARN is logged about the failure of processing the 70th message
6) JPA consumer is scheduled again, and pickup a new ResultSet with 41
rows. And will process each row one by one.
7) Now processing the 1st message fails, because on last poll that
message failed as well
8) There is no good messages to commit
9) A WARN is logged about the failure of processing the 1th message
... and it will repeat itself.
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
Re: Misleading jmx statistics on jpa component
Posted by Claus Ibsen <cl...@gmail.com>.
On Sat, Nov 12, 2011 at 2:03 PM, Preben.Asmussen <pr...@dr.dk> wrote:
> Added comment to https://issues.apache.org/jira/browse/CAMEL-4668
>
> If the jmx stats. doesn't reflect that the exchanges have failed, then it
> would be hard to use the statistics for eg. monitoring tools.
>
Its not hard, the monitoring tool can detect the failed exchange, and
react accordingly.
> --
> View this message in context: http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4986867.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
Re: Misleading jmx statistics on jpa component
Posted by "Preben.Asmussen" <pr...@dr.dk>.
Added comment to https://issues.apache.org/jira/browse/CAMEL-4668
If the jmx stats. doesn't reflect that the exchanges have failed, then it
would be hard to use the statistics for eg. monitoring tools.
--
View this message in context: http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4986867.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Misleading jmx statistics on jpa component
Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Nov 4, 2011 at 7:21 PM, Preben.Asmussen <pr...@dr.dk> wrote:
> It seems that there are at least 2 discussions going on here if I'm not
> wrong.
>
> That Spring tries to commit even though the transaction is marked for
> rollback, and that that the jmx statistics reflects completed on exchanges
> that are rolled back.
>
> At the end whole batch of 100 is rolled back, but the statistics reflects
> that some are completed. Should this be regarded as this expected behaviour
> ?
Yes the JMX stats is individually per exchange.
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4964858.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
Re: Misleading jmx statistics on jpa component
Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Nov 4, 2011 at 7:21 PM, Preben.Asmussen <pr...@dr.dk> wrote:
> It seems that there are at least 2 discussions going on here if I'm not
> wrong.
>
> That Spring tries to commit even though the transaction is marked for
> rollback, and that that the jmx statistics reflects completed on exchanges
> that are rolled back.
>
Yeah the JPA consumer should rollback, that is a bug which I have
reproduced and will get fixed.
> At the end whole batch of 100 is rolled back, but the statistics reflects
> that some are completed. Should this be regarded as this expected behaviour
> ?
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4964858.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
Re: Misleading jmx statistics on jpa component
Posted by "Preben.Asmussen" <pr...@dr.dk>.
It seems that there are at least 2 discussions going on here if I'm not
wrong.
That Spring tries to commit even though the transaction is marked for
rollback, and that that the jmx statistics reflects completed on exchanges
that are rolled back.
At the end whole batch of 100 is rolled back, but the statistics reflects
that some are completed. Should this be regarded as this expected behaviour
?
--
View this message in context: http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4964858.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Misleading jmx statistics on jpa component
Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Nov 4, 2011 at 10:57 AM, Christian Schneider
<ch...@die-schneider.net> wrote:
> Well so it is code in spring that tries to commit. Still I would rather
> expect that the transaction should be rolled back.
>
Spring TX is weird. Even if you mark the TX for rollback only, it may
still commit it.
The solution is to throw a runtime exception in the doInTransaciton
method, like we do in the Camel TransactionErrorHandler.
That's possible what is missing in the camel-jpa, which possible have
a doInTransaction method or something like that.
> Christian
>
> Am 04.11.2011 10:24, schrieb bvahdat:
>>
>> Hi Christian,
>>
>> IMHO one can easily see that it's not camel trying to commit the
>> transaction
>> (in contrast to what you claimed) but the current spring
>> PlatformTransactionManager in charge, in this given case it's spring
>> JpaTransactionManager, the relevant part by the stacktrace is:
>>
>> ...
>> at
>>
>> org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
>> at
>>
>> org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
>> at
>>
>> org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:147)
>> ...
>>
>> In contrary camel's TransactionErrorHandler.processInTransaction() clearly
>> warns about the current transaction getting rolled back:
>>
>> ...
>> [rip.adapters.rap.PublicationIn] TransactionErrorHandler WARN
>> Transaction rollback (0x5113f0) for ExchangeId:
>> ID-W14523-2657-1320391149162-0-141
>> ...
>>
>> On the other hand there's not much I can say regarding the misleading jmx
>> statistics but as far as I remember there was some added support for the
>> JMX-notifications introduced in:
>>
>> https://issues.apache.org/jira/browse/CAMEL-4516
>>
>> @Omar Atia: I think you're in the wrong chat-room ;-)
>>
>> Regards, Babak
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4963451.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> Talend Application Integration Division http://www.talend.com
>
>
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
Re: Misleading jmx statistics on jpa component
Posted by Christian Schneider <ch...@die-schneider.net>.
Well so it is code in spring that tries to commit. Still I would rather
expect that the transaction should be rolled back.
Christian
Am 04.11.2011 10:24, schrieb bvahdat:
> Hi Christian,
>
> IMHO one can easily see that it's not camel trying to commit the transaction
> (in contrast to what you claimed) but the current spring
> PlatformTransactionManager in charge, in this given case it's spring
> JpaTransactionManager, the relevant part by the stacktrace is:
>
> ...
> at
> org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
> at
> org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
> at
> org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:147)
> ...
>
> In contrary camel's TransactionErrorHandler.processInTransaction() clearly
> warns about the current transaction getting rolled back:
>
> ...
> [rip.adapters.rap.PublicationIn] TransactionErrorHandler WARN
> Transaction rollback (0x5113f0) for ExchangeId:
> ID-W14523-2657-1320391149162-0-141
> ...
>
> On the other hand there's not much I can say regarding the misleading jmx
> statistics but as far as I remember there was some added support for the
> JMX-notifications introduced in:
>
> https://issues.apache.org/jira/browse/CAMEL-4516
>
> @Omar Atia: I think you're in the wrong chat-room ;-)
>
> Regards, Babak
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4963451.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
Talend Application Integration Division http://www.talend.com
Re: Misleading jmx statistics on jpa component
Posted by bvahdat <ba...@swissonline.ch>.
Hi Christian,
IMHO one can easily see that it's not camel trying to commit the transaction
(in contrast to what you claimed) but the current spring
PlatformTransactionManager in charge, in this given case it's spring
JpaTransactionManager, the relevant part by the stacktrace is:
...
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:147)
...
In contrary camel's TransactionErrorHandler.processInTransaction() clearly
warns about the current transaction getting rolled back:
...
[rip.adapters.rap.PublicationIn] TransactionErrorHandler WARN
Transaction rollback (0x5113f0) for ExchangeId:
ID-W14523-2657-1320391149162-0-141
...
On the other hand there's not much I can say regarding the misleading jmx
statistics but as far as I remember there was some added support for the
JMX-notifications introduced in:
https://issues.apache.org/jira/browse/CAMEL-4516
@Omar Atia: I think you're in the wrong chat-room ;-)
Regards, Babak
--
View this message in context: http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4963451.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Misleading jmx statistics on jpa component
Posted by Christian Schneider <ch...@die-schneider.net>.
Hi Preben,
I am not so much concerned about the rollback but rather that camel
tries to commit.
The trace shows that the transaction is marked as rollback only. I guess
that happens because of the exception that is thrown.
I think camel should in this case roll back the transaction and not try
to commit.
---
caused by: Could not commit JPA transaction; nested exception is
javax.persistence.RollbackException: Transaction marked as rollbackOnly
---
Christian
Am 04.11.2011 08:28, schrieb Preben.Asmussen:
> Hi Christian
>
> Here is a nice trace.
>
> As you can see the whole batch is rolled back when redelivery gets
> exhausted.
>
> [rip.adapters.rap.PublicationIn] DefaultErrorHandler WARN Failed
> delivery for exchangeId: ID-W14523-2657-1320391149162-0-141. On delivery
> attempt: 0 caught: java.lang.RuntimeException: unable to parse publication
> with id 1234
> [rip.adapters.rap.PublicationIn] DefaultErrorHandler WARN Failed
> delivery for exchangeId: ID-W14523-2657-1320391149162-0-141. On delivery
> attempt: 1 caught: java.lang.RuntimeException: unable to parse publication
> with id 1234
> [rip.adapters.rap.PublicationIn] DefaultErrorHandler WARN Failed
> delivery for exchangeId: ID-W14523-2657-1320391149162-0-141. On delivery
> attempt: 2 caught: java.lang.RuntimeException: unable to parse publication
> with id 1234
> [rip.adapters.rap.PublicationIn] DefaultErrorHandler WARN Failed
> delivery for exchangeId: ID-W14523-2657-1320391149162-0-141. On delivery
> attempt: 3 caught: java.lang.RuntimeException: unable to parse publication
> with id 1234
> [rip.adapters.rap.PublicationIn] rap ERROR
> Exchange[Id:ID-W14523-2657-1320391149162-0-141, ExchangePattern:InOnly,
> Properties:{CamelToEndpoint=log://dk.dr.drip.adapters.rap?level=ERROR&showAll=true,
> CamelBatchComplete=false, CamelBatchSize=100, CamelCreatedTimestamp=Fri Nov
> 04 08:19:14 CET 2011, CamelBatchIndex=70,
> CamelExceptionCaught=java.lang.RuntimeException: unable to parse publication
> with id 1234}, Headers:{CamelRedelivered=true, CamelRedeliveryMaxCounter=3,
> CamelRedeliveryCounter=3,
> CamelInterceptedEndpoint=log://dk.dr.drip.adapters.rap?level=ERROR&showAll=true,
> CamelJpaTemplate=org.springframework.orm.jpa.JpaTemplate@192e317,
> breadcrumbId=ID-W14523-2657-1320391149162-0-142},
> BodyType:dk.dr.drip.adapters.rap.PublicationIn, Body:PublicationIn
> [sekvens=71, publicationId=1234, runningOrderId=3229431],
> CaughtExceptionType:java.lang.RuntimeException,
> CaughtExceptionMessage:unable to parse publication with id 1234,
> StackTrace:java.lang.RuntimeException: unable to parse publication with id
> 1234
> at
> dk.dr.drip.adapters.rap.PublicationBuilder.buildPublication(PublicationBuilder.java:56)
> at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:329)
> at
> org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:231)
> at
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:169)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
> at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:171)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
> at org.apache.camel.processor.interceptor.Debug$1.process(Debug.java:50)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)
> at
> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:116)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:79)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)
> at
> org.apache.camel.spring.spi.TransactionErrorHandler.processByErrorHandler(TransactionErrorHandler.java:206)
> at
> org.apache.camel.spring.spi.TransactionErrorHandler$1.doInTransactionWithoutResult(TransactionErrorHandler.java:166)
> at
> org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
> at
> org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
> at
> org.apache.camel.spring.spi.TransactionErrorHandler.doInTransactionTemplate(TransactionErrorHandler.java:159)
> at
> org.apache.camel.spring.spi.TransactionErrorHandler.processInTransaction(TransactionErrorHandler.java:120)
> at
> org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:94)
> at
> org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:103)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
> at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:171)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
> at org.apache.camel.processor.interceptor.Debug$1.process(Debug.java:50)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)
> at
> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)
> at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)
> at
> org.apache.camel.component.jpa.JpaConsumer.processBatch(JpaConsumer.java:142)
> at
> org.apache.camel.component.jpa.JpaConsumer$1.doInJpa(JpaConsumer.java:97)
> at
> org.apache.camel.component.jpa.JpaTemplateTransactionStrategy$1$1.doInJpa(JpaTemplateTransactionStrategy.java:82)
> at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:183)
> at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:146)
> at
> org.apache.camel.component.jpa.JpaTemplateTransactionStrategy$1.doInTransaction(JpaTemplateTransactionStrategy.java:80)
> at
> org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
> at
> org.apache.camel.component.jpa.JpaTemplateTransactionStrategy.execute(JpaTemplateTransactionStrategy.java:78)
> at org.apache.camel.component.jpa.JpaConsumer.poll(JpaConsumer.java:80)
> at
> org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:133)
> at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:88)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
> at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:619)
> , Out: null]
> [rip.adapters.rap.PublicationIn] DefaultErrorHandler ERROR Failed
> delivery for exchangeId: ID-W14523-2657-1320391149162-0-141. Exhausted after
> delivery attempt: 4 caught: java.lang.RuntimeException: unable to parse
> publication with id 1234. Processed by failure processor:
> FatalFallbackErrorHandler[Channel[sendTo(Endpoint[log://dk.dr.drip.adapters.rap?level=ERROR&showAll=true])]]
> java.lang.RuntimeException: unable to parse publication with id 1234
> at
> dk.dr.drip.adapters.rap.PublicationBuilder.buildPublication(PublicationBuilder.java:56)
> at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:329)
> at
> org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:231)
> at
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:169)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
> at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:171)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
> at org.apache.camel.processor.interceptor.Debug$1.process(Debug.java:50)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)
> at
> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:116)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:79)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)
> at
> org.apache.camel.spring.spi.TransactionErrorHandler.processByErrorHandler(TransactionErrorHandler.java:206)
> at
> org.apache.camel.spring.spi.TransactionErrorHandler$1.doInTransactionWithoutResult(TransactionErrorHandler.java:166)
> at
> org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
> at
> org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
> at
> org.apache.camel.spring.spi.TransactionErrorHandler.doInTransactionTemplate(TransactionErrorHandler.java:159)
> at
> org.apache.camel.spring.spi.TransactionErrorHandler.processInTransaction(TransactionErrorHandler.java:120)
> at
> org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:94)
> at
> org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:103)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
> at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:171)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
> at org.apache.camel.processor.interceptor.Debug$1.process(Debug.java:50)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)
> at
> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)
> at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)
> at
> org.apache.camel.component.jpa.JpaConsumer.processBatch(JpaConsumer.java:142)
> at
> org.apache.camel.component.jpa.JpaConsumer$1.doInJpa(JpaConsumer.java:97)
> at
> org.apache.camel.component.jpa.JpaTemplateTransactionStrategy$1$1.doInJpa(JpaTemplateTransactionStrategy.java:82)
> at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:183)
> at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:146)
> at
> org.apache.camel.component.jpa.JpaTemplateTransactionStrategy$1.doInTransaction(JpaTemplateTransactionStrategy.java:80)
> at
> org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
> at
> org.apache.camel.component.jpa.JpaTemplateTransactionStrategy.execute(JpaTemplateTransactionStrategy.java:78)
> at org.apache.camel.component.jpa.JpaConsumer.poll(JpaConsumer.java:80)
> at
> org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:133)
> at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:88)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
> at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:619)
> [rip.adapters.rap.PublicationIn] TransactionErrorHandler WARN
> Transaction rollback (0x5113f0) for ExchangeId:
> ID-W14523-2657-1320391149162-0-141 due exception:
> java.lang.RuntimeException: unable to parse publication with id 1234
> [rip.adapters.rap.PublicationIn] ultPollingConsumerPollStrategy WARN
> Consumer
> Consumer[jpa://dk.dr.drip.adapters.rap.PublicationIn?consumeLockEntity=false&consumer.query=select+p+from+dk.dr.drip.adapters.rap.PublicationIn+p+order+by+sekvens&maximumResults=100]
> could not poll endpoint:
> Endpoint[jpa://dk.dr.drip.adapters.rap.PublicationIn?consumeLockEntity=false&consumer.query=select+p+from+dk.dr.drip.adapters.rap.PublicationIn+p+order+by+sekvens&maximumResults=100]
> caused by: Could not commit JPA transaction; nested exception is
> javax.persistence.RollbackException: Transaction marked as rollbackOnly
> org.springframework.transaction.TransactionSystemException: Could not commit
> JPA transaction; nested exception is javax.persistence.RollbackException:
> Transaction marked as rollbackOnly
> at
> org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:476)
> at
> org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
> at
> org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
> at
> org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:147)
> at
> org.apache.camel.component.jpa.JpaTemplateTransactionStrategy.execute(JpaTemplateTransactionStrategy.java:78)
> at org.apache.camel.component.jpa.JpaConsumer.poll(JpaConsumer.java:80)
> at
> org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:133)
> at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:88)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
> at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: javax.persistence.RollbackException: Transaction marked as
> rollbackOnly
> at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:51)
> at
> org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:467)
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4963230.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
Talend Application Integration Division http://www.talend.com
Re: Misleading jmx statistics on jpa component
Posted by "Preben.Asmussen" <pr...@dr.dk>.
Hi Christian
Here is a nice trace.
As you can see the whole batch is rolled back when redelivery gets
exhausted.
[rip.adapters.rap.PublicationIn] DefaultErrorHandler WARN Failed
delivery for exchangeId: ID-W14523-2657-1320391149162-0-141. On delivery
attempt: 0 caught: java.lang.RuntimeException: unable to parse publication
with id 1234
[rip.adapters.rap.PublicationIn] DefaultErrorHandler WARN Failed
delivery for exchangeId: ID-W14523-2657-1320391149162-0-141. On delivery
attempt: 1 caught: java.lang.RuntimeException: unable to parse publication
with id 1234
[rip.adapters.rap.PublicationIn] DefaultErrorHandler WARN Failed
delivery for exchangeId: ID-W14523-2657-1320391149162-0-141. On delivery
attempt: 2 caught: java.lang.RuntimeException: unable to parse publication
with id 1234
[rip.adapters.rap.PublicationIn] DefaultErrorHandler WARN Failed
delivery for exchangeId: ID-W14523-2657-1320391149162-0-141. On delivery
attempt: 3 caught: java.lang.RuntimeException: unable to parse publication
with id 1234
[rip.adapters.rap.PublicationIn] rap ERROR
Exchange[Id:ID-W14523-2657-1320391149162-0-141, ExchangePattern:InOnly,
Properties:{CamelToEndpoint=log://dk.dr.drip.adapters.rap?level=ERROR&showAll=true,
CamelBatchComplete=false, CamelBatchSize=100, CamelCreatedTimestamp=Fri Nov
04 08:19:14 CET 2011, CamelBatchIndex=70,
CamelExceptionCaught=java.lang.RuntimeException: unable to parse publication
with id 1234}, Headers:{CamelRedelivered=true, CamelRedeliveryMaxCounter=3,
CamelRedeliveryCounter=3,
CamelInterceptedEndpoint=log://dk.dr.drip.adapters.rap?level=ERROR&showAll=true,
CamelJpaTemplate=org.springframework.orm.jpa.JpaTemplate@192e317,
breadcrumbId=ID-W14523-2657-1320391149162-0-142},
BodyType:dk.dr.drip.adapters.rap.PublicationIn, Body:PublicationIn
[sekvens=71, publicationId=1234, runningOrderId=3229431],
CaughtExceptionType:java.lang.RuntimeException,
CaughtExceptionMessage:unable to parse publication with id 1234,
StackTrace:java.lang.RuntimeException: unable to parse publication with id
1234
at
dk.dr.drip.adapters.rap.PublicationBuilder.buildPublication(PublicationBuilder.java:56)
at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:329)
at
org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:231)
at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:169)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:171)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at org.apache.camel.processor.interceptor.Debug$1.process(Debug.java:50)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)
at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:116)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:79)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)
at
org.apache.camel.spring.spi.TransactionErrorHandler.processByErrorHandler(TransactionErrorHandler.java:206)
at
org.apache.camel.spring.spi.TransactionErrorHandler$1.doInTransactionWithoutResult(TransactionErrorHandler.java:166)
at
org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at
org.apache.camel.spring.spi.TransactionErrorHandler.doInTransactionTemplate(TransactionErrorHandler.java:159)
at
org.apache.camel.spring.spi.TransactionErrorHandler.processInTransaction(TransactionErrorHandler.java:120)
at
org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:94)
at
org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:103)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:171)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at org.apache.camel.processor.interceptor.Debug$1.process(Debug.java:50)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)
at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)
at
org.apache.camel.component.jpa.JpaConsumer.processBatch(JpaConsumer.java:142)
at
org.apache.camel.component.jpa.JpaConsumer$1.doInJpa(JpaConsumer.java:97)
at
org.apache.camel.component.jpa.JpaTemplateTransactionStrategy$1$1.doInJpa(JpaTemplateTransactionStrategy.java:82)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:183)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:146)
at
org.apache.camel.component.jpa.JpaTemplateTransactionStrategy$1.doInTransaction(JpaTemplateTransactionStrategy.java:80)
at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at
org.apache.camel.component.jpa.JpaTemplateTransactionStrategy.execute(JpaTemplateTransactionStrategy.java:78)
at org.apache.camel.component.jpa.JpaConsumer.poll(JpaConsumer.java:80)
at
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:133)
at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:88)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
, Out: null]
[rip.adapters.rap.PublicationIn] DefaultErrorHandler ERROR Failed
delivery for exchangeId: ID-W14523-2657-1320391149162-0-141. Exhausted after
delivery attempt: 4 caught: java.lang.RuntimeException: unable to parse
publication with id 1234. Processed by failure processor:
FatalFallbackErrorHandler[Channel[sendTo(Endpoint[log://dk.dr.drip.adapters.rap?level=ERROR&showAll=true])]]
java.lang.RuntimeException: unable to parse publication with id 1234
at
dk.dr.drip.adapters.rap.PublicationBuilder.buildPublication(PublicationBuilder.java:56)
at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:329)
at
org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:231)
at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:169)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:171)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at org.apache.camel.processor.interceptor.Debug$1.process(Debug.java:50)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)
at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:116)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:79)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:61)
at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)
at
org.apache.camel.spring.spi.TransactionErrorHandler.processByErrorHandler(TransactionErrorHandler.java:206)
at
org.apache.camel.spring.spi.TransactionErrorHandler$1.doInTransactionWithoutResult(TransactionErrorHandler.java:166)
at
org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at
org.apache.camel.spring.spi.TransactionErrorHandler.doInTransactionTemplate(TransactionErrorHandler.java:159)
at
org.apache.camel.spring.spi.TransactionErrorHandler.processInTransaction(TransactionErrorHandler.java:120)
at
org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:94)
at
org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:103)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:171)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at org.apache.camel.processor.interceptor.Debug$1.process(Debug.java:50)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)
at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)
at
org.apache.camel.component.jpa.JpaConsumer.processBatch(JpaConsumer.java:142)
at
org.apache.camel.component.jpa.JpaConsumer$1.doInJpa(JpaConsumer.java:97)
at
org.apache.camel.component.jpa.JpaTemplateTransactionStrategy$1$1.doInJpa(JpaTemplateTransactionStrategy.java:82)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:183)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:146)
at
org.apache.camel.component.jpa.JpaTemplateTransactionStrategy$1.doInTransaction(JpaTemplateTransactionStrategy.java:80)
at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at
org.apache.camel.component.jpa.JpaTemplateTransactionStrategy.execute(JpaTemplateTransactionStrategy.java:78)
at org.apache.camel.component.jpa.JpaConsumer.poll(JpaConsumer.java:80)
at
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:133)
at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:88)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
[rip.adapters.rap.PublicationIn] TransactionErrorHandler WARN
Transaction rollback (0x5113f0) for ExchangeId:
ID-W14523-2657-1320391149162-0-141 due exception:
java.lang.RuntimeException: unable to parse publication with id 1234
[rip.adapters.rap.PublicationIn] ultPollingConsumerPollStrategy WARN
Consumer
Consumer[jpa://dk.dr.drip.adapters.rap.PublicationIn?consumeLockEntity=false&consumer.query=select+p+from+dk.dr.drip.adapters.rap.PublicationIn+p+order+by+sekvens&maximumResults=100]
could not poll endpoint:
Endpoint[jpa://dk.dr.drip.adapters.rap.PublicationIn?consumeLockEntity=false&consumer.query=select+p+from+dk.dr.drip.adapters.rap.PublicationIn+p+order+by+sekvens&maximumResults=100]
caused by: Could not commit JPA transaction; nested exception is
javax.persistence.RollbackException: Transaction marked as rollbackOnly
org.springframework.transaction.TransactionSystemException: Could not commit
JPA transaction; nested exception is javax.persistence.RollbackException:
Transaction marked as rollbackOnly
at
org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:476)
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:147)
at
org.apache.camel.component.jpa.JpaTemplateTransactionStrategy.execute(JpaTemplateTransactionStrategy.java:78)
at org.apache.camel.component.jpa.JpaConsumer.poll(JpaConsumer.java:80)
at
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:133)
at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:88)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.persistence.RollbackException: Transaction marked as
rollbackOnly
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:51)
at
org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:467)
--
View this message in context: http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4963230.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Misleading jmx statistics on jpa component
Posted by Christian Schneider <ch...@die-schneider.net>.
Hi Preben,
could you also post the log snippet where it shows that the transaction
is rollback only?
Christian
Am 03.11.2011 10:00, schrieb Preben.Asmussen:
> Im using the jpa component as a consumer to poll a table. The batchsize of
> each poll is set to eg. 100 as :
>
> <from uri="jpa:org.apache.camel.MyEntity?consumer.query=select x from
> org.apache.MyEntity x order by
> sekvens&maximumResults=100&consumeLockEntity=false" />
> <transacted/>
>
> The route is transacted so at the end the whole batch is either successful,
> or gets rolled back i there is a problem with any of the records read.
>
> It works nicely - the problem is that the jmx statistics on the route logs
> each exchange as completed even though at the end everything might get
> rolled back. In my opinion they should be regarded as failed instead. ?
>
> Camel version 2.8.1
>
> /preben
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Misleading-jmx-statistics-on-jpa-component-tp4960503p4960503.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
Talend Application Integration Division http://www.talend.com