简体   繁体   中英

Dapper procedure returns nothing after refresh

I've got a huge problem. I use dapper as micro orm in my project and when I make a query with stored procedure in package IT WORKS (but only the first time, after second and third the same query, same parameters and same execution returns nothing ). After while, that query works again, but still only for one time same as before.

But when I do the same query from database (in sqldeveloper) it always works So I claim that a problem is connected with dapper. I guess.

I have no idea how to fix this. I have changed that procedure to a function but effect is still the same. I work on OracleDb, in asp MVC ofc.

The execution of procedure is :

var Parm = new OracleDynamicParameters();
Parm.Add("refCur", OracleDbType.RefCursor, ParameterDirection.Output);
Parm.Add(name: "ID", value: id, direction: ParameterDirection.Input);
return con.Query<SAMPLE_MODEL>("SAMPLE_PACKAGE.SAMPLE_PROC", Parm, commandType: CommandType.StoredProcedure).ToList();

Check that every session got a unit id. Every query which uses a dblink requires a new session id with the database.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM