I am trying to tune a performance sensitive server code which uses EF 6.0 and Devart 8.5
I am now down to combing through each individual Oracle call.
I see "Rollback" just before every "Close connection", although all I do are selects.
1. Can it be somehow avoided?
2. Can you please print milliseconds in the Time Stamp column with at least 3 digits precision (in dbMonitor)?
Your timely response on question 1 will be greatly appreciated.
dbMonitor shows Rollback before Close Connection. Why?
Re: dbMonitor shows Rollback before Close Connection. Why?
1. As a workaround, you can open/close connections manually. Please open the connection used by Entity Framework context in the following way (depending on the template used in your model):
a) ObjectContext:
var conn = (MyObjectContext.Connection as System.Data.EntityClient.EntityConnection).StoreConnection;
conn.Open();
...
conn.Close();
b) DbContext:
var conn = (((IObjectContextAdapter)MyDbContext).ObjectContext.Connection as System.Data.EntityClient.EntityConnection).StoreConnection;
conn.Open();
...
conn.Close();
This will make Entity Framework not to open/close connection automatically during every interoperation with a database. If connection is opened manually, it remains in the opened state until user closes it himself.
2. Thank you for your suggestion. We will consider the possibility of adding milliseconds in the Time Stamp column.
a) ObjectContext:
var conn = (MyObjectContext.Connection as System.Data.EntityClient.EntityConnection).StoreConnection;
conn.Open();
...
conn.Close();
b) DbContext:
var conn = (((IObjectContextAdapter)MyDbContext).ObjectContext.Connection as System.Data.EntityClient.EntityConnection).StoreConnection;
conn.Open();
...
conn.Close();
This will make Entity Framework not to open/close connection automatically during every interoperation with a database. If connection is opened manually, it remains in the opened state until user closes it himself.
2. Thank you for your suggestion. We will consider the possibility of adding milliseconds in the Time Stamp column.