Looking at your graph (which in my case appears only when answering), there is the same number of calls to AutoFlushIfRequired in both cases, but its performances are way slower in the first case. This is logical since when there is no transaction, there is no auto-flush either (early exit in AutoFlushIfRequired).
I do not think comparing the no-transaction case to the transaction case will help nailing down what is responsible for the change between 3.3 and 5.1. Not having a transaction has a big impact on what does NHibernate, notably due to disabling auto-flushes.You would have better profiling 3.3 vs 5.1, provided the application has not changed otherwise, especially in the way it uses sessions. (Readonly or not, quantity of entities loaded in a session, interceptors and events used, ...) By the way, if your application does series of queries without altering any entity, it is a good idea to disable auto-flushes (and add a manual call to flush if anything was changed) by setting session.FlushMode to a lower value till the end of the queries. Note NHibernate 5.0.0 and 5.0.1 were having some performance regressions, fixed in 5.0.2 (#1455 <https://github.com/nhibernate/nhibernate-core/pull/1455>, #1453 <https://github.com/nhibernate/nhibernate-core/pull/1453>). So if you do test with 5.0 and not 5.1 as written initially, take the latest 5.0 version (5.0.6 currently). Le mardi 3 juillet 2018 01:42:06 UTC+2, sravan a écrit : > > I did the profiling of application, when using Transactions vs when not > using transactions. when using transactions seems like AutoFlushIfRequired > is called > > several times, which seems to be culprit. Is there is any change in NH > 5.x onwards in the way flush is performed. we didn't change flush settings > when migrated to NH 5.0 from 3.3 > > > <https://lh3.googleusercontent.com/-Ijx__2CsIU8/Wzq3E_JeWmI/AAAAAAAACrQ/3TUtthQinIocKXkoBacXjTa45YKBB78CACLcBGAs/s1600/Tx_Issues.jpg> > > > On Saturday, June 30, 2018 at 2:55:22 AM UTC-7, Frédéric Delaporte wrote: >> >> This is not a known trouble. Moreover the rework only concerned >> transaction scopes, not ITransaction. I have no clue about what happens in >> your case. >> >> Le vendredi 29 juin 2018 18:16:26 UTC+2, sravan a écrit : >>> >>> Recently Upgraded our mission critical application to use NH 5.1 from >>> NH 3.3. NH 5.1 performance is comparable to NH 3.3 when not using >>> transactions but >>> it drops down dramatically when using Transactions. The degradation is >>> happening either using NHibernate ITransaction or Transaction scopes. >>> Seems like whole Transaction handling has been revisited from NH 5.0. Is >>> there is any setting that needs to be turned on to bring the performance >>> back to normal. >>> >>> Here is the session factory configuration >>> >>> <entry key="hibernate.connection.connection_string" value="XXXXX"/> >>> <entry key="hibernate.connection.provider" value= >>> "NHibernate.Connection.DriverConnectionProvider"/> >>> <entry key="dialect" value="NHibernate.Dialect.MsSql2012Dialect" >>> /> >>> <entry key="connection.driver_class" value= >>> "NHibernate.Driver.SqlClientDriver"/> >>> <entry key="current_session_context_class" value="wcf_operation" >>> /> >>> <entry key="show_sql" value="true"></entry> >>> <entry key="command_timeout" value="12000"></entry> >>> <entry key="track_session_id" value="false"></entry> >>> Enter code here... >>> >>> >>> -- --- You received this message because you are subscribed to the Google Groups "nhibernate-development" group. To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-development+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.