Enterprise library makes a sql run slower

Topics: Enterprise Library Core
Mar 19, 2012 at 5:44 PM

I have in total three sqls in a .net web application that connect to an oracle database out of which only two are slower. I have modified the code for these two sqls,I tried to open a connection and execute the sql and stopped using Enterprise library and it made them run faster.  I am not sure why enterprise library would make it slower. The sql text, parameters all remain the same.

Did anybody have a similar experience with Enterprise library. please let me know.

Mar 20, 2012 at 4:12 AM

Are you saying that the Enterprise Library code runs slower than straight ADO.NET code?  I haven't heard of that before.  

Are you using OracleClient or ODP?  I would recommend profiling the application to find out where the time is spent.

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com 

Mar 20, 2012 at 1:47 PM

yeah, that is what is happening with me. It gets weird when only two queries have this behavior out of the three queries.

I have modified my code to use ODP.

I have also tried with a different version of Enterprise library but still have these queries run slow.

Could you please let me know if there is something else I am missing when using Enterprise library or do I have to take something else into consideration. I have used Enterprise library many times but never ran into this type of issue.

 

thank you.

Mar 20, 2012 at 2:19 PM

Are you using the Oracle ODP.NET Data Provider from the Entlib Contrib project or OracleClient (which is what is used by Entlib out of the box for Oracle)?  OracleClient is deprecated so ODB.NET should be used for new development.

First I would change to use the ODP.NET Data Provider (if you are not using it already).
If that doesn't help then I would  run SQL Trace to see what the differences are on the Oracle side for both scenarios (slow vs. fast).
If the performance from both of those scenarios look about the same then I would run .NET profiling to see where the time is spent.  

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com 

Mar 20, 2012 at 2:45 PM

I am using OracleClient that comes with Entlib.

I will try to use Oracle ODP.NET Data Provider from the Entlib Contrib project and test my application.

Thank you for the guidance.

Mar 21, 2012 at 5:00 PM

I noticed in the entlibcontrib-5.0.505.0-2011-10-29-bin\bin dir the Oracle.DataAccess.dll file is version 2.111.7.10. 

I think Oracle is now shipping 11.2.0\client_1\odp.net\bin\4\Oracle.DataAccess.dll which is version 4.112.3.0, which Oracle says has performance improvements.