【发布时间】:2015-12-02 06:21:59
【问题描述】:
问题: 过程中的 OUT 变量未返回。
背景: 我最近将一个应用程序从 Oracle 10g 更新到了 Oracle 11G。我们使用的是 12c 版本的 Oracle 客户端。
应用程序在 .NET 3.5 上运行。
Database db = CreateDatabase(connectionName);
var dbCmd = db.GetStoredProcCommand(procedureName);
ConvertParams(ref dbCmd, parameters);
try
{
iReturn = db.ExecuteNonQuery(dbCmd, _transaction);
if (transaction == null) //if a transaction hasn't been passed, it isn't intended to has control over commit/rollback out of method, so app can do it
_transaction.Commit();
}
catch (Exception ex)
{
if (transaction == null)
_transaction.Rollback();
throw ex;
}
finally
{
DebugSpCommand(procedureName, parameters);
GetOutputParams(ref parameters, dbCmd);
if (transaction == null)
{
if (_transaction.Connection != null)
_transaction.Connection.Close();
_transaction.Dispose();
}
}
}
catch (OracleException ex)
{
Framework.ErrorHandling.ErrorHandler.HandleException(ex, "DATA_LAYER_POLICY");
Framework.Logging.Logger.Write(ex.Message, LogCategories.Debug);
iReturn = ex.Code;
}
catch (Exception ex)
{
Framework.ErrorHandling.ErrorHandler.HandleException(ex, "DATA_LAYER_POLICY");
Framework.Logging.Logger.Write(ex.Message, LogCategories.Debug);
}
【问题讨论】:
标签: c# .net oracle oracle11g ado.net