Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 32526 invoked from network); 11 Jun 2007 12:22:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Jun 2007 12:22:55 -0000 Received: (qmail 12541 invoked by uid 500); 11 Jun 2007 12:22:58 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 12516 invoked by uid 500); 11 Jun 2007 12:22:58 -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 12506 invoked by uid 99); 11 Jun 2007 12:22:58 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jun 2007 05:22:58 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jun 2007 05:22:54 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0A2147141FA for ; Mon, 11 Jun 2007 05:22:34 -0700 (PDT) Message-ID: <32652912.1181564554038.JavaMail.jira@brutus> Date: Mon, 11 Jun 2007 05:22:34 -0700 (PDT) From: "James Strachan (JIRA)" To: dev@activemq.apache.org Subject: [jira] Resolved: (AMQ-1263) JDBC Master/Slave: After database failure, stale db connections are reused in DefaultdatabaseLocker In-Reply-To: <23304054.1180993412892.JavaMail.jira@brutus> 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 [ https://issues.apache.org/activemq/browse/AMQ-1263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] James Strachan resolved AMQ-1263. --------------------------------- Resolution: Fixed Fix Version/s: 5.0.0 Patch applied with thanks! > JDBC Master/Slave: After database failure, stale db connections are reused in DefaultdatabaseLocker > --------------------------------------------------------------------------------------------------- > > Key: AMQ-1263 > URL: https://issues.apache.org/activemq/browse/AMQ-1263 > Project: ActiveMQ > Issue Type: Bug > Components: Message Store > Affects Versions: 5.x > Environment: Linux x86, Postgresql 8.1 > Reporter: Eric Anderson > Fix For: 5.0.0 > > Attachments: patch.txt > > > Start two brokers in a JDBC master/slave configuration. One will become master, the other slave. > Shutdown the database. > The slave will immediately begin emitting emitting database connection exceptions messages from the DefaultdatabaseLocker. > Bring up the database again. > The slave continues to emit database error messages and all subsequent attempts by the DefaultdatabaseLocker to issue its locking query will fail. > The problem is that the DefaultdatabaseLocker grabs one db connection at startup and never releases it. Therefore unless the JDBC connection has an auto-reconnect feature, the slave broker is dead in the water, because its Connection is bad. The fix is to allocate a new Connection and PreparedStatement on every iteration of the database locker loop, and free the statement/connection on any Exception. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.