You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Clinton Begin (JIRA)" <ib...@incubator.apache.org> on 2005/02/12 21:25:14 UTC

[jira] Closed: (IBATIS-34) Exception while serializable NULL value (CacheModel)

     [ http://issues.apache.org/jira/browse/IBATIS-34?page=history ]
     
Clinton Begin closed IBATIS-34:
-------------------------------

    Assign To: Larry Meadors

fixed as larry decribed

> Exception while serializable NULL value (CacheModel)
> ----------------------------------------------------
>
>          Key: IBATIS-34
>          URL: http://issues.apache.org/jira/browse/IBATIS-34
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>     Versions: 2.0.8
>  Environment: Cache turn on: <settings cacheModelsEnabled="true" />
> Cache model:
> <cacheModel id="ActionCacheModel" type="LRU" readOnly="false" serialize="true">
>    ...
> </cacheModel>
>     Reporter: Alexander Dederer
>     Assignee: Larry Meadors
>     Priority: Critical
>  Attachments: CacheModel.java
>
> Method addObject craches when trying serializate null value.
> INFO:
> SQL request return empty ResultSet. CacheModel.java trying caching null value througth Serializable is serialize variable is TRUE and craches with Exception.
> To resolve this bug nedeed changes in addObject and getObject methods:
> /* com.ibatis.sqlmap.engine.cache.CacheModel.addObject */
> 300    if (null == value) value = NULL_OBJECT;
> 301    if (serialize && !readOnly && value != null) {
> to:
> 300    if (null == value) value = NULL_OBJECT;
> 301    if (serialize && !readOnly && value != NULL_OBJECT) { 
> /* com.ibatis.sqlmap.engine.cache.CacheModel.getObject */
> 270    if (serialize && !readOnly && value != null) {
> to:
> 270    if (serialize && !readOnly && (value != NULL_OBJECT && value != null)) { 
> and finally return realy null referene when founded NULL_OBJECT in the cache:
> 289    return value;
> to:
> 289    return value == NULL_OBJECT ? null : value; 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira