Dapper Hangs at Execute

假装没事ソ 提交于 2019-12-10 21:04:47

问题


I have an - IDbConnection - sql = @"UPDATE tablename SET json = :json, lastupdate = SYSDATE WHERE id = :id"

var param = new DynamicParameters();
param.Add(":json", json, DbType.AnsiString);
param.Add(":id", currentTemplate.Id);

if (connection == null || connection.State != ConnectionState.Open) continue;
connection.Execute(sql, param);  // hangs here.
connection.Query(sql, param);  // tried this and this also hangs.

Coding stops at connection.Execute. No error or anything. Just hangs.

:json is a serialized object returned by JsonConvert.

:id is a string

I've also tried removing the parameters and including the values in the SQL itself.


回答1:


In my case, I had an uncommitted transaction in another session, as described here: Oracle Update Hangs



来源:https://stackoverflow.com/questions/27029951/dapper-hangs-at-execute

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!