1

关于这个问题有几个问题,但没有一个得到真正的回答。

基本上 - 当前是否有用于当前使用的 enlib (6.0) 的 ODP.NET 实现?或者我是否必须为 ODP.NET 编写映射/自定义 DAO?

通用数据库只能让我到目前为止,它与 Oracle 存储过程持平(使用 GenericDatabase 的连接不支持可怕的“参数发现”。您必须明确指定参数,或将连接配置为使用派生自 Database 的类型支持参数发现的错误)

我知道 entlibcontrib 项目 - 但这似乎被搁置/死亡,因为它自 2011/entlib 5.0 以来没有新的发布。

任何关于 entlib 的自定义 DAO 开发的指针或建议,将不胜感激。

4

2 回答 2

2

Here's our official stand on this:

If you are working with an Oracle database, you can use the Oracle provider included with Enterprise Library and the ADO.NET Oracle provider, which requires you to reference or add the assembly System.Data.OracleClient.dll. However, keep in mind that the OracleClient provider is deprecated in version 4.0 of the .NET Framework, and support for this provider is deprecated in Enterprise Library 6. Although support for the OracleClient provider is still included in Enterprise Library 6, for future development you should consider choosing a different implementation of the Database class that uses a different Oracle driver.

I haven't come across an implementation of ODP.NET for EntLib6. If you do end up updating the one available on EntLibContrib for v5.0, please post it to the contrib site for others to benefit from. Should be fairly straightforward, no major changes to DAAB in v6.

I wish I had a better answer for you, but at the end of the day it comes down to prioritization of stories for the release and this one wasn't high enough of the stackrank for my team to pick up.

于 2013-07-28T01:31:37.283 回答
0

我们正在使用 ODP.NET 和企业库中的 GenericDatabase 对象成功连接到 Oracle 11g。

我们在 Oracle 包中运行存储过程时遇到了问题(忘记确切的错误是什么,但我们在实际使用之前处理命令时遇到了一些问题),我们对企业库进行了一些小改动来处理它.

在 SprocAccessor.cs 中,我们修改了

public override IEnumerable<TResult> Execute(params object[] parameterValues)

看起来像这样

public override IEnumerable<TResult> Execute(params object[] parameterValues)
{
    using (DbCommand command = Database.GetStoredProcCommand(procedureName))
    {            
        parameterMapper.AssignParameters(command, parameterValues);                
        //return base.Execute(command);  Removed 

        //foreach added by ngpojne.  This allows the command to be used before it is disposed of.
        foreach (TResult result in base.Execute(command))
        {
            yield return result;
        }
    }
}
于 2014-06-12T14:38:12.843 回答