BUG of IBatis.net's cacheModel. when you setting Cachemodel named "select" statement and the query result is null,the cache of IBatis does not work and throw an exception. int IBatis.net 1.321. I check the cs source. find 3 points in MappedStatements.cs .line:400, 527 778. i modify the souce as follows:
obj = RunQueryForObject(request, session, parameterObject, resultObject); if(obj!=null) { _statement.CacheModel[key] = obj; }