3

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.

JuanPablo
  • 813
  • 7
  • 11
  • does the same thing work via ADO.NET directly? is `json` actually a `string`? – Marc Gravell Nov 20 '14 at 10:43
  • I hadn't tried ADO. Yes, the JSON was just a string. Once I tried it at work, it functioned properly. I'm still curious why this happened! – JuanPablo Nov 21 '14 at 14:47
  • 1
    I'm tempted to say: a problem inside idbconnecton, perhaps relating to connectivity; dapper doesn't do anything particularly exciting here – Marc Gravell Nov 26 '14 at 15:30

1 Answers1

3

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

Community
  • 1
  • 1
Loren Paulsen
  • 8,960
  • 1
  • 28
  • 38