You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Max Jonas Werner (JIRA)" <ib...@incubator.apache.org> on 2007/07/19 18:50:06 UTC

[jira] Issue Comment Edited: (IBATIS-436) Defaults for element aren't applied if it doesn't exist

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

Max Jonas Werner edited comment on IBATIS-436 at 7/19/07 9:49 AM:
------------------------------------------------------------------

This bug is quite annoying, it really twisted my mind for several hours today.


 was:
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 far.

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