Frans
Sat Nov 25 04:44:23 CST 2006
MrSmersh wrote:
> You are not giving up I see ;) So letâ??s slip a bit into off topic.
> Probably is an interesting topic for you considering what your
> company does, in fact we are talking about a solution to the same
> problem but a completely different approach.
>
> OK so this is how it works, you have a reader or any data object.
> You want a data value if it works int i = reader.GetInt32(8) for
> Microsoft provider will work also for Oracle (even if the native
> provider returns a decimal value or anything). In the data object
> called is taken care of uniform type conversion.
ah, but you need a type conversion layer somewhere. Sure, I have that
too (to /from any .NET type if you want, it's pluggable), though normal
usage with just the ado.net provider, you won't get this working.
ODP.NET OracleDataReader.GetInt32 won't give you an int if the
precision is >= 10. With MS' provider this is unclear (calls into
native OCI methods)
> As programming model you use the database abstraction layer data
> objects as are used in the simplest MSDN sample, you have them reader
> table etc. As result, you get an application 100% agnostic of the
> database. To say more the flip of the switch just say what provider
> is preferred, the first one found will be used.
> Again this DAL works for SQLServer, Oracle, PostgreSQL, all DB2 (AS
> 400 and Universal), and other database are in preparation, Iâ??m
> told. And not the least for all the databases supported you get the
> catalog info, tables, columns, types, triggers so on.
Sure, with a conversion layer, anything is possible, I know that, but
I was talking about people using the ado.net provider and default .NET
constructs, i.e. not using a 3rd party dal / OR mapper.
FB
>
>
> "Frans Bouma [C# MVP]" wrote:
>
> > MrSmersh wrote:
> >
> > > Ok so letâ??s call it tie :), because we had such different
> > > experiences, and both are so convinced by the validity of the
> > > results.
> > >
> > > About swapping the database abstraction layer we use make it very
> > > simple, just modify one value in the configuration file and you
> > > are done. Even can try to use the native one and if is not
> > > available use the Microsoft one. And of course that takes care
> > > of data type mapping, the data reader will give the â??good
> > > valuesâ??.
> >
> > Erm... let's say I have this code:
> > int customerID = myCustomer.ID;
> >
> > and myCustomer is a Customer entity filled from Oracle using
> > ODP.NET. Now, you say you just flip a switch in some config file.
> >
> > Erm... you can do that, but that doesn't mean my int customerID
> > code will all of a sudden become decimal customerID = ...
> >
> > FB
> >
> > > The most comprehensive test on this issue we have done with
> > > Oracle 9i and with the 1.1 versions of the providers. We have
> > > tried with the â??other versionsâ?? but not so thoroughly, the
> > > difference seemed to be thereâ?¦ And the database abstraction
> > > layer is not to blame, or who knows, maybe a different
> > > programming approach, specific for each of the provider will give
> > > better performance.
> > >
> > >
> > > "Frans Bouma [C# MVP]" wrote:
> > >
> > > > MrSmersh wrote:
> > > >
> > > > > I do stand by what I said (but if Iâ??m wrong I leaned
> > > > > something).
> > > >
> > > > that's great but my experiences are different. Also, it's not
> > > > easy to swap providers, because of the NUMBER(x, y) -> .NET type
> > > > mappings which differ alot between ODP.NET and MS' oracle
> > > > provider.
> > > >
> > > > > Of what version of Oracle are we talking?
> > > >
> > > > that doesnt' matter.
> > > >
> > > > > I do suppose that are we talking about .Net 2.0 providers.
> > > >
> > > > that also doesn't matter in this case.
> > > >
> > > > FB
> > > >
> > > > >
> > > > >
> > > > > "Frans Bouma [C# MVP]" wrote:
> > > > >
> > > > > > Marina Levit [MVP] wrote:
> > > > > >
> > > > > > > Anyone have experience with the provider from Microsoft
> > > > > > > vs. the one from Oracle? I haven't looked very much at
> > > > > > > either. One would assume that the one written by Oracle
> > > > > > > itself should perform better, since they should be able
> > > > > > > to optimize it?
> > > > > >
> > > > > > MS' version doesn't support the XML type, it always
> > > > > > returns any NUMBER(x,y) as decimal and doesn't have some of
> > > > > > the fancy features ODP.NET supports. There are also minor
> > > > > > issues with varchar fields: you can't save a UNICODE
> > > > > > encoded string in a varchar field, because when you set the
> > > > > > parameter's OracleType to VarChar, it will result into
> > > > > > using DbType.AnsiString under the hood, allowing only
> > > > > > non-unicoded strings. This is of course to support 8i, but
> > > > > > when you're using 9i or higher this sucks bigtime if you
> > > > > > need to store unicoded strings.
> > > > > >
> > > > > > ODP.NET and MS' provider are on par with performance, as
> > > > > > both rely on the Oracle CLI (client interface). You have to
> > > > > > install the client no matter what, so with MS' provider
> > > > > > you've to install the client separately, with ODP.NET you
> > > > > > get the client installed.
> > > > > > I'd pick ODP.NET without any hesitation. Not only does it
> > > > > > support more features but you can say what you want about
> > > > > > Oracle, they DO release bugfixes from time to time, while
> > > > > > Microsoft is very slow to release bugfixes (service packs
> > > > > > for .net framework).
--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website:
http://www.llblgen.com
My .NET blog:
http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------