Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 91483 invoked from network); 10 Apr 2008 14:38:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Apr 2008 14:38:33 -0000 Received: (qmail 97672 invoked by uid 500); 10 Apr 2008 14:38:33 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 97649 invoked by uid 500); 10 Apr 2008 14:38:33 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 97634 invoked by uid 99); 10 Apr 2008 14:38:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Apr 2008 07:38:33 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Apr 2008 14:37:59 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8AA30234C0C3 for ; Thu, 10 Apr 2008 07:35:43 -0700 (PDT) Message-ID: <646876129.1207838143566.JavaMail.jira@brutus> Date: Thu, 10 Apr 2008 07:35:43 -0700 (PDT) From: "Rob Davies (JIRA)" To: dev@activemq.apache.org Subject: [jira] Updated: (AMQ-678) MessageCleanup fails with mysql 4.1.x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ 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.