ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Max Jonas Werner (JIRA)" <ibatis-...@incubator.apache.org>
Subject [jira] Commented: (IBATIS-436) Defaults for <settings/> element aren't applied if it doesn't exist
Date Thu, 19 Jul 2007 16:50:06 GMT

    [ https://issues.apache.org/jira/browse/IBATIS-436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12513942

Max Jonas Werner commented on IBATIS-436:

Yeah, this bug is really annoying, it really twisted my mind for several hours today.

> Defaults for <settings/> element aren't applied if it doesn't exist
> -------------------------------------------------------------------
>                 Key: IBATIS-436
>                 URL: https://issues.apache.org/jira/browse/IBATIS-436
>             Project: iBatis for Java
>          Issue Type: Bug
>          Components: SQL Maps
>    Affects Versions: 2.3.0
>         Environment: iBatis 2.3.0, Java 1.5, Spring 2.0.7
>            Reporter: Nilesh Kapadia
> If you don't include <settings> element in sqlMapConfig, the defaults (that are
described in the documentation) aren't properly applied.  This definitely applies to cacheModelsEnabled
setting.  cacheModelsEnabled is false if you don't have a <settings> element, and true
if you do.  I have not looked at whether this affects other elements (I'd imagine all booleans
that are supposed to default to true are affected).
> The problem appears to be that when the <settings> element doesn't exist, most
of the code in addSettingsNodelets() method in SqlMapConfigParser does not execute (the anonymous
class and method that implements Nodelet never executes).  It appears that this code is where
the defaults are normally applied.
> In SqlMapExecutorDelegate, the isCacheModelsEnabled() method is returning false because
the boolean cacheModelsEnabled is never set and thus defaults to false.
> The workaround is of course to include <settings/> in sqlMapConfig.  But most examples
out there don't include this element, so there is the possibility that many apps are running
with the incorrect defaults.
> I have not checked if this issue exists in previous versions, only looked at 2.3.0 so

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message