Return-Path: X-Original-To: apmail-empire-db-commits-archive@www.apache.org Delivered-To: apmail-empire-db-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 7471D10CB6 for ; Thu, 15 Aug 2013 13:37:50 +0000 (UTC) Received: (qmail 57863 invoked by uid 500); 15 Aug 2013 13:37:49 -0000 Delivered-To: apmail-empire-db-commits-archive@empire-db.apache.org Received: (qmail 56858 invoked by uid 500); 15 Aug 2013 13:37:48 -0000 Mailing-List: contact commits-help@empire-db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: empire-db-dev@empire-db.apache.org Delivered-To: mailing list commits@empire-db.apache.org Received: (qmail 56722 invoked by uid 500); 15 Aug 2013 13:37:48 -0000 Delivered-To: apmail-incubator-empire-db-commits@incubator.apache.org Received: (qmail 56686 invoked by uid 99); 15 Aug 2013 13:37:47 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Aug 2013 13:37:47 +0000 Date: Thu, 15 Aug 2013 13:37:47 +0000 (UTC) From: "Harald Kirsch (JIRA)" To: empire-db-commits@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (EMPIREDB-189) DBDatabase.getSingleInt with default does not return the default but throws an exception. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Harald Kirsch created EMPIREDB-189: -------------------------------------- Summary: DBDatabase.getSingleInt with default does not return the default but throws an exception. Key: EMPIREDB-189 URL: https://issues.apache.org/jira/browse/EMPIREDB-189 Project: Empire-DB Issue Type: Bug Affects Versions: empire-db-2.4.1 Reporter: Harald Kirsch The method getSingleInt with default value should return the default value if there is no record found in the database. Instead it throws QueryNoResultException, which correctly comes right out of querySingleValue. getSingleInt should catch the exception and return the default provided. Alternatively, I would rather add the default value also to getSingleValue to prevent the expensive generation of an exception in this case. This, however, would make it difficult to have null as the default value. But I think this is rather not a meaningful default in a db context anyway. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira