IBatisNet.DataMapper.SqlMapper

public string GetDataCacheStats() 
{
        StringBuilder buffer = new StringBuilder("\nCache Data
Statistiques");
        buffer.Append("\n=======================\n");
        IDictionaryEnumerator enumerator =
_mappedStatements.GetEnumerator();
        while (enumerator.MoveNext()) 
        {
                MappedStatement statement = (MappedStatement)
enumerator.Value;
                                buffer.Append(statement.Name);
                                buffer.Append(": ");
                                double hitRatio =
statement.GetDataCacheHitRatio();
                                if (hitRatio != -1) 
                                {
        
buffer.Append(Math.Round(hitRatio * 100));
                                        buffer.Append("%");
                                } 
                                else 
                                {
                                        buffer.Append("No Cache.");
                                }
                                buffer.Append("\n");
                        }
                        return buffer.ToString();
        }
}

InvalidCastException at ln 1340. 

MappedStatement statement = (MappedStatement) enumerator.Value;

I debug and surprising the statement cached is an object of
CachingStatement that no inherits from MappedStatement.



Reply via email to