From activemq-dev-return-654-apmail-geronimo-activemq-dev-archive=geronimo.apache.org@geronimo.apache.org Thu Apr 06 14:05:18 2006 Return-Path: Delivered-To: apmail-geronimo-activemq-dev-archive@www.apache.org Received: (qmail 25536 invoked from network); 6 Apr 2006 14:05:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Apr 2006 14:05:17 -0000 Received: (qmail 57893 invoked by uid 500); 6 Apr 2006 14:05:15 -0000 Delivered-To: apmail-geronimo-activemq-dev-archive@geronimo.apache.org Received: (qmail 57761 invoked by uid 500); 6 Apr 2006 14:05:14 -0000 Mailing-List: contact activemq-dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-dev@geronimo.apache.org Received: (qmail 57750 invoked by uid 99); 6 Apr 2006 14:05:14 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Apr 2006 07:05:14 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Apr 2006 07:05:13 -0700 Received: from ajax (localhost.localdomain [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id D3A47D49FE for ; Thu, 6 Apr 2006 15:04:52 +0100 (BST) Message-ID: <134495191.1144332292845.JavaMail.jira@ajax> Date: Thu, 6 Apr 2006 15:04:52 +0100 (BST) From: "Paul Focke (JIRA)" To: activemq-dev@geronimo.apache.org Subject: [jira] Created: (AMQ-678) MessageCleanup fails with mysql 4.1.x MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N MessageCleanup fails with mysql 4.1.x ------------------------------------- Key: AMQ-678 URL: https://issues.apache.org/activemq/browse/AMQ-678 Project: ActiveMQ Type: Bug Components: Message Store Versions: 4.0 M4 Reporter: Paul Focke Priority: Minor 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. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira