dbMonitor shows Rollback before Close Connection. Why?

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
maxima120
Posts: 11
Joined: Tue 15 Mar 2016 14:19

dbMonitor shows Rollback before Close Connection. Why?

Post by maxima120 » Tue 21 Jun 2016 19:31

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.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: dbMonitor shows Rollback before Close Connection. Why?

Post by Shalex » Mon 27 Jun 2016 09:56

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.

Post Reply