Question

There are a couple of questions floating around about this, but none have been really answered.

Basically - is there currently an implementation of ODP.NET for enlib (6.0) currently being used? Or will I have to go down the route of writing a mapping / custom DAO for ODP.NET?

The generic database can only get me so far, it falls flat with Oracle stored procedures (the dreaded 'Parameter discovery is not supported for connections using GenericDatabase. You must specify the parameters explicitly, or configure the connection to use a type deriving from Database that supports parameter discovery' error)

I am aware of the entlibcontrib project - but this seems to be on hold/dead as it has not had a new realease since 2011/entlib 5.0.

Any pointers, or advice about custom DAO development for entlib, would be appreciated.

Was it helpful?

Solution

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.

OTHER TIPS

We are successfully connecting to Oracle 11g using ODP.NET and the GenericDatabase object in the enterprise library.

We had an issue running stored procedure in Oracle packages (forget what the exact error was, but we had some issue with the command being disposed of before it was actually used), and we made a small change to the enterprise library to deal with it.

In SprocAccessor.cs, we modified

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

to look like this

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;
        }
    }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top