You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@empire-db.apache.org by "Rainer Döbele (JIRA)" <em...@incubator.apache.org> on 2013/08/27 11:36:52 UTC

[jira] [Assigned] (EMPIREDB-189) DBDatabase.getSingleInt with default does not return the default but throws an exception.

     [ https://issues.apache.org/jira/browse/EMPIREDB-189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rainer Döbele reassigned EMPIREDB-189:
--------------------------------------

    Assignee: Rainer Döbele
    
> 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
>            Assignee: Rainer Döbele
>
> 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