You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Phil Kulak (JIRA)" <ib...@incubator.apache.org> on 2005/12/01 20:31:32 UTC

[jira] Created: (IBATISNET-129) iBatis cache can't handle null values

iBatis cache can't handle null values
-------------------------------------

         Key: IBATISNET-129
         URL: http://issues.apache.org/jira/browse/IBATISNET-129
     Project: iBatis for .NET
        Type: Bug
  Components: DataMapper  
    Versions: DataMapper 1.2.1    
 Environment: .NET 2.0
    Reporter: Phil Kulak


Here's the relevent source from MappedStatement.cs:

obj = _statement.CacheModel[key];
if (obj == null) 
{
	obj = RunQueryForObject(request, session, parameterObject, resultObject);
	_statement.CacheModel[key] = obj;
}

Notice that this code assumes that a null value means that the key doesn't exist when the key could exist and just be mapped to null, as is the case for a query that returns no result. This causes an "Item has already been added." exception.

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (IBATISNET-129) iBatis cache can't handle null values

Posted by "Gilles Bayon (JIRA)" <ib...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/IBATISNET-129?page=all ]
     
Gilles Bayon closed IBATISNET-129:
----------------------------------

    Fix Version: DataMapper 1.3
     Resolution: Invalid
      Assign To: Gilles Bayon

Already fixed in SVN

> iBatis cache can't handle null values
> -------------------------------------
>
>          Key: IBATISNET-129
>          URL: http://issues.apache.org/jira/browse/IBATISNET-129
>      Project: iBatis for .NET
>         Type: Bug
>   Components: DataMapper
>     Versions: DataMapper 1.2.1
>  Environment: .NET 2.0
>     Reporter: Phil Kulak
>     Assignee: Gilles Bayon
>      Fix For: DataMapper 1.3

>
> Here's the relevent source from MappedStatement.cs:
> obj = _statement.CacheModel[key];
> if (obj == null) 
> {
> 	obj = RunQueryForObject(request, session, parameterObject, resultObject);
> 	_statement.CacheModel[key] = obj;
> }
> Notice that this code assumes that a null value means that the key doesn't exist when the key could exist and just be mapped to null, as is the case for a query that returns no result. This causes an "Item has already been added." exception.

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira