There should be no problems with applying NGEN on the Devart.* assemblies.
Please consider the following information to improve performance of your application.
--------
Using EF
--------
Key points:
1. The Batch Updates feature increases the performance of CUD (insert/update/delete) operations made via EF:
http://blogs.devart.com/dotconnect/new- ... html#Batch.
2. You can employ Oracle optimizer hints support in Entity Framework:
http://blogs.devart.com/dotconnect/usin ... ework.html
3. We recommend using TransactionScope only for saving data (not for multiple read/save-s):
a) use
Code: Select all
using (var firstConext = new FirstContext())
{
using (var secondConext = new SecondContext())
{
// ... multiple reading 1
// ... multiple reading 2
using (var transactionscope = new TransactionScope())
{
// ... saving 1
// ... saving 2
transactionscope.Commit();
}
}
}
instead of
Code: Select all
using (var transactionscope = new TransactionScope())
{
using (var firstConext = new FirstContext())
{
// ... multiple reading 1
// ... saving 1
}
using (var secondConext = new SecondContext())
{
// ... multiple reading 2
// ... saving 2
}
transactionscope.Commit();
}
b) Also take into account the peculiarities of Entity Framework. For example, if you are using multiple read/save-s before applying ts.Commit(), all used connections are accumulated (they will be released only after ts.Commit()). It makes sense to open connection manually so that EF would not open/"close" them for each database interoperation - in this case EF context would use only this single connection.
Use
Code: Select all
using (var transactionscope = new TransactionScope())
{
using (var firstConext = new FirstContext())
{
firstConext.Connection.Open();
// ... multiple reading 1
// ... saving 1
}
using (var secondConext = new SecondContext())
{
secondConext.Connection.Open();
// ... multiple reading 2
// ... saving 2
}
transactionscope.Commit();
}
instead of
Code: Select all
using (var transactionscope = new TransactionScope())
{
using (var firstConext = new FirstContext())
{
// ... multiple reading 1
// ... saving 1
}
using (var secondConext = new SecondContext())
{
// ... multiple reading 2
// ... saving 2
}
transactionscope.Commit();
}
This is a sample for ObjectContext. In case of DbContext, it has to be cast to IObjectContextAdapter:
Code: Select all
((IObjectContextAdapter)сontext).ObjectContext.Connection.Open();
-------------------
Using plain ADO.NET
-------------------
Key points:
1. dotConnect for Oracle provides two ways of fast data insertion:
a) using the OracleLoader class ->
http://www.devart.com/dotconnect/oracle ... oader.html
b) using array binding ->
http://www.devart.com/dotconnect/oracle ... yBind.html
2. The fastest way of reading data is usage of OracleDataReader:
http://www.devart.com/dotconnect/oracle ... eader.html
Entity Framework is slower than a plain ADO.NET because of overhead expenses:
https://msdn.microsoft.com/en-us/library/cc853327.aspx.