简体   繁体   English

Oracle Odp.Net在无效程序包中调用过程时未报告错误

[英]Oracle Odp.Net unreported error on call to procedure in invalid package

I just got my worst maintenance nightmare : a silent error. 我刚刚遇到了最糟糕的维护噩梦:一个无声的错误。

I was calling a procedure using Odp.Net inside a custom package, and the procedure call failed silently without any exception being thrown (verified using both step by step debug and a catch all clause). 我在自定义包中调用了一个使用Odp.Net的过程,并且过程调用无声地失败而没有抛出任何异常(使用逐步调试和catch all子句进行验证)。 After much searching I noticed that the Package was invalidated (some mishap on the server), after recompiling the package everything was back to normal (the call code was correct and unmodified). 经过多次搜索后,我发现Package无效(服务器上发生了一些事故),重新编译后,一切都恢复正常(调用代码是正确的,未经修改)。

Since it is really easy to invalidate a package accidentally in Oracle, I need to catch this kind of error, if only to log them for debugging. 由于在Oracle中意外地使包失效非常容易,我需要捕获这种错误,如果只记录它们进行调试。

With MS's System.Data.OracleClient an OracleException was thrown in this case, is there any way to get a similar behavior with Oracle's Oracle.DataAccess ? 使用MS的System.Data.OracleClient,在这种情况下抛出了OracleException,有没有办法在Oracle的Oracle.DataAccess中获得类似的行为? Some kind of sqlnet.ora parameter ? 某种sqlnet.ora参数? I found no similar problem anywhere on the net. 我在网上的任何地方都没有发现类似的问题。

using Oracle11R2 server, latest Oracle Win32 client. 使用Oracle11R2服务器,最新的Oracle Win32客户端。 .Net3.5. .NET3.5。

Have you tried enabling odp.net trace log? 您是否尝试过启用odp.net跟踪日志?

<oracle.dataaccess.client>
  <settings>
   <add name="TraceFileName" value="c:\odpnet1.trc"/>
   <add name="TraceLevel" value="63"/>
 </settings>
 </oracle.dataaccess.client>

Maybe it will shed some light? 也许它会有所启发?

It is provider trouble. 这是提供商的麻烦。 I've changed ODP.NET after similar exception. 在类似的异常后我改变了ODP.NET。 Now I'm using dotConnect for Oracle and recommend you to do the same thing. 现在我正在使用dotConnect for Oracle,并建议你做同样的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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