activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Tully (JIRA)" <>
Subject [jira] Issue Comment Edited: (AMQ-2880) Exception thrown during commit leads to message loss
Date Wed, 08 Sep 2010 16:37:41 GMT


Gary Tully edited comment on AMQ-2880 at 9/8/10 12:37 PM:

new xa test variant from patch applied. thanks for the work on this one. XA case is now sorted.

      was (Author: gtully):
new xa test variant from patch applied. thanks for the work on this one. XA case is not sorted.

> Exception thrown during commit leads to message loss
> ----------------------------------------------------
>                 Key: AMQ-2880
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.4.0
>            Reporter: Stan Lewis
>            Assignee: Gary Tully
>             Fix For: 5.4.1
>         Attachments: patch_for_xa_transaction.txt, test-case.txt, test-case.txt, xa-test-case.txt
> In cases where JDBC persistence is used and the database server is under a fair bit of
load it's sometimes possible for table/row locks to time out, which means you'll see exceptions
such as:
> java.sql.BatchUpdateException: Lock wait timeout exceeded; try restarting transaction
> at com.mysql.jdbc.PreparedStatement.executeBatchSerially(
> at com.mysql.jdbc.PreparedStatement.executeBatch(
> at org.apache.commons.dbcp.DelegatingStatement.executeBatch(
> at org.apache.commons.dbcp.DelegatingStatement.executeBatch(
> at
> at
> at
> at
> at$Tx.commit(
> at
> at org.apache.activemq.transaction.XATransaction.commit(
> at
> at
> at
> at org.apache.activemq.command.TransactionInfo.visit(
> at
> at$1.onCommand(
> at org.apache.activemq.transport.TransportFilter.onCommand(
> at org.apache.activemq.transport.WireFormatNegotiator.onCommand(
> at org.apache.activemq.transport.InactivityMonitor.onCommand(
> at org.apache.activemq.transport.TransportSupport.doConsume(
> at org.apache.activemq.transport.tcp.TcpTransport.doRun(
> at
> at
> In this case the connection to the database is fine and what we should do is retry the
transaction as it's a temporary failure condition.  Instead what happens is the broker moves
to the next message in the queue, leaving the current message in the database.  The message
won't show up in the web console and cannot be consumed by any consumers until the broker
is restarted.
> Attached is a test case that simulates the error condition in a controlled fashion by
using a subclassed JDBCPersistenceAdapter that will throw an exception in commitTransaction
as necessary.  So the producer sends 10 messages and then the consumer tries to consume them,
during this time the persistence adapter will throw an exception during commitTransaction.
 Then the condition is cleared and the consumer can consume all 10 messages, however the consumer
only consumes 9 messages, the 1st message in the sequence is still in the database.  Hopefully
the logging makes this clear.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message