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

Rob Davies updated AMQ-678:
---------------------------

    Fix Version/s: 5.2.0
                       (was: 5.1.0)

> MessageCleanup fails with mysql 4.1.x
> -------------------------------------
>
>                 Key: AMQ-678
>                 URL: https://issues.apache.org/activemq/browse/AMQ-678
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Message Store
>    Affects Versions: 4.0 M4
>            Reporter: Paul Focke
>            Priority: Minor
>             Fix For: 5.2.0
>
>         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.
-
You can reply to this email to add a comment to the issue online.

Reply via email to