Return-Path: X-Original-To: apmail-jackrabbit-commits-archive@www.apache.org Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A205F91E5 for ; Fri, 3 Aug 2012 09:37:28 +0000 (UTC) Received: (qmail 50476 invoked by uid 500); 3 Aug 2012 09:37:28 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 50364 invoked by uid 500); 3 Aug 2012 09:37:27 -0000 Mailing-List: contact commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list commits@jackrabbit.apache.org Received: (qmail 50338 invoked by uid 99); 3 Aug 2012 09:37:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Aug 2012 09:37:26 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Aug 2012 09:37:25 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 1B453238890B; Fri, 3 Aug 2012 09:36:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1368847 - in /jackrabbit/branches/2.4: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionHelper.java Date: Fri, 03 Aug 2012 09:36:41 -0000 To: commits@jackrabbit.apache.org From: jukka@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120803093642.1B453238890B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jukka Date: Fri Aug 3 09:36:41 2012 New Revision: 1368847 URL: http://svn.apache.org/viewvc?rev=1368847&view=rev Log: 2.4: Merged revision 1360571 (JCR-3383) Modified: jackrabbit/branches/2.4/ (props changed) jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionHelper.java Propchange: jackrabbit/branches/2.4/ ------------------------------------------------------------------------------ Merged /jackrabbit/trunk:r1360571 Modified: jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java?rev=1368847&r1=1368846&r2=1368847&view=diff ============================================================================== --- jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java (original) +++ jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java Fri Aug 3 09:36:41 2012 @@ -496,7 +496,7 @@ public class BundleDbPersistenceManager } failures++; log.error("Failed to persist ChangeLog (stacktrace on DEBUG log level), blockOnConnectionLoss = " - + blockOnConnectionLoss, lastException); + + blockOnConnectionLoss + ": " + lastException); log.debug("Failed to persist ChangeLog", lastException); if (blockOnConnectionLoss || failures <= 1) { // if we're going to try again try { @@ -827,13 +827,15 @@ public class BundleDbPersistenceManager ResultSet rs = conHelper.exec(bundleSelectSQL, getKey(id), false, 0); try { - if (rs.next()) { + if (rs != null && rs.next()) { return readBundle(id, rs, 1); } else { return null; } } finally { - rs.close(); + if (rs != null) { + rs.close(); + } } } catch (SQLException e) { String msg = "failed to read bundle: " + id + ": " + e; Modified: jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionHelper.java URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionHelper.java?rev=1368847&r1=1368846&r2=1368847&view=diff ============================================================================== --- jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionHelper.java (original) +++ jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionHelper.java Fri Aug 3 09:36:41 2012 @@ -399,6 +399,7 @@ public class ConnectionHelper { } // Don't wrap null if (rs == null) { + closeResources(con, stmt, rs); return null; } if (inBatchMode()) { @@ -494,7 +495,7 @@ public class ConnectionHelper { } catch (SQLException e) { lastException = e; } - log.error("Failed to execute SQL (stacktrace on DEBUG log level)", lastException); + log.error("Failed to execute SQL (stacktrace on DEBUG log level): " + lastException); log.debug("Failed to execute SQL", lastException); failures++; if (blockOnConnectionLoss || failures <= RETRIES) { // if we're going to try again