现象,Dapper执行Sql超时,在查询分析器里面执行Sql很快
通过分析发现被转换成了 exec sp_executesql '你的Sql'
stackoverflow说法:http://stackoverflow.com/questions/15683197/weird-timeout-issues-with-dapper-net
最终换了写法,不使用缓存。timeout时间设置为120s
using (var conn = new SqlConnection(RDBSBase.ConnectionString))
{
conn.Open();
var queryList = conn.Query<T>(strs, _dy, null, false, 120, CommandType.Text);
tbhylist = queryList.ToList();
}
关键字: Dapper HitCache timeout