Rollback displayed in dbmonitor

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
dhoenig
Posts: 16
Joined: Tue 20 Jul 2010 20:33

Rollback displayed in dbmonitor

Post by dhoenig » Fri 27 Apr 2012 15:23

Has anyone noticed the Rollback command showing up in dbmonitor when closing connections? To test this I setup a simple console app that connects and immediately disconnects from the oracle server. When I look in dbmonitor I see Rollback as a command that was executed.

Why does rollback show up when I'm not rolling anything back?

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

Re: Rollback displayed in dbmonitor

Post by Shalex » Tue 01 May 2012 13:43

Please refer to http://www.devart.com/dotconnect/oracle ... story.html:
6.50.244 11-Nov-11
Behaviour is changed: pending operations on a connection are rolled back before returning the connection to pool

This behaviour is applied only when pooling is used. If you include the "Pooling=false;" option to your connection string, there will be no rollback.

dhoenig
Posts: 16
Joined: Tue 20 Jul 2010 20:33

Re: Rollback displayed in dbmonitor

Post by dhoenig » Tue 01 May 2012 14:21

Ok, thanks for the response!

Just curious...if I open and then close the connection, what operation is pending that needs to be rolled back??

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

Re: Rollback displayed in dbmonitor

Post by Shalex » Thu 03 May 2012 12:05

dhoenig wrote:if I open and then close the connection, what operation is pending that needs to be rolled back??
We do not count all the commands which are executed on the current connection (because it can be even a trigger on a log on which changes data). That's why we always do a roll back when returning connection to the pool.

maxima120
Posts: 11
Joined: Tue 15 Mar 2016 14:19

Re: Rollback displayed in dbmonitor

Post by maxima120 » Tue 21 Jun 2016 19:59

I just stumbled upon this and am very disappointed.

What I have is several EF calls like context.Table.Where(...).ToList()...

And after each I have same thing over and over again - Rollback, Connection closed, Connection is returned to pool.

Min rollback timing is 65ms (up to 200 at some point). All are after select.

If I have thousand selects a minute then I will have to wait extra 65 sec on your rollbacks.

This is unacceptable.

You have to do something about it.. Oracle is about performance. Those users who are still using it are there mostly because of performance.. Wasting 100ms after each request just because "you don't count" something is wrong.

If I switch off pooling - it incurs twice as much performance penalty - close connection takes about same time as a Rollback, but then there is something called Disconnect which takes exactly same time as closing connection.. What are you disconnecting exactly?

What options do I have ?

Is this even an enterprise class solution? I thought it is but I was wrong.

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

Re: Rollback displayed in dbmonitor

Post by Shalex » Mon 27 Jun 2016 09:52

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.

Post Reply