You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Timothy Bish (JIRA)" <ji...@apache.org> on 2011/07/02 21:22:21 UTC

[jira] [Closed] (AMQ-678) MessageCleanup fails with mysql 4.1.x

     [ https://issues.apache.org/jira/browse/AMQ-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Bish closed AMQ-678.
----------------------------

       Resolution: Won't Fix
    Fix Version/s:     (was: 4.1.3)

The 4.x broker line is EOL

> MessageCleanup fails with mysql 4.1.x
> -------------------------------------
>
>                 Key: AMQ-678
>                 URL: https://issues.apache.org/jira/browse/AMQ-678
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Message Store
>    Affects Versions: 4.0 M4
>            Reporter: Paul Focke
>            Priority: Minor
>         Attachments: deleteOldMessages.patch
>
>
> When ActiveMQ does a message cleanup using mysql-4.1 for jdbc persistence an error occurs.  ActiveMQ complains that the connection is already closed.  The nested exception however is an EOFException.  The exception is thrown by DefaultJDBCAdapter.doDeleteOldMessages(DefaultJDBCAdapter.java:544).  I poked around I found that the sql statement it produces causes mysql to crash.  It even causes mysqld to crash when entered in the mysql client console, so this is not a Connector/J issue.  Here is the statement
> DELETE FROM ACTIVEMQ_MSGS WHERE ( EXPIRATION<>0 AND EXPIRATION<1144326387433) OR ID <= ( SELECT min(ACTIVEMQ_ACKS.LAST_ACKED_ID) FROM ACTIVEMQ_ACKS WHERE ACTIVEMQ_ACKS.CONTAINER=ACTIVEMQ_MSGS.CONTAINER)
> It can be found in Statements.java:220.
> I have tested this under mysql 4.1.12, 4.1.13 & 5.0.18.  The exceptions were only thrown in mysql 4.1.  5.0 behaved as would be expected.
> Possible solutions would be : 
>  - rewrite the delete statement so that it doesn't kill mysqld : 
>     - I had a quick look into rewriting the statement but I haven't found how
>     - change the current delete into a select id from ... (this works) and delete records 1 by 1 using the resultSet ( which really sucks when there are lots of messages to be deleted )
>  - not use mysql-4.1

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira