Most of the transaction rework was about system transactions (transaction scopes). Regular transaction handling was not modified much.
Using > <entry key="transaction.factory_class" value=" > NHibernate.Transaction.AdoNetTransactionFactory"/> > as suggested is valid only if you do not use system transactions. This transaction factory just ignores transaction scopes. Moreover, the system transaction handling of the default transaction factory is normally not involved when using regular transactions, so switching the transaction factory should not have much impacts on projects only using regular transactions, included on performances, while it is a bug source for other projects. Between the two transaction factories, the main difference when only using regular transactions is the fact the system aware one (and default one) will check on many occasions whether a system transaction is ongoing or not. This can be avoided by disabling the auto-join transaction feature, and explicitly asking the session to join the system transaction when you use one. https://nhibernate.info/doc/nhibernate-reference/transactions.html#transactions-scopes The rework on system transactions has introduced thread synchronization logic to avoid concurrency troubles occurring with distributed transactions. So far it seems to have fixed most of the issues NHibernate was having with distributed transaction scopes, so it is unlikely it will be undone. Maybe a "non-distributed system transaction" factory could be added for those not needing to support distributed transactions, and supposing the performance loss comes from these synchronizations. But things are very tricky there, a scope can be elevated to distributed on many unexpected cases. (Using ODBC data provider, or providers from SAP products (Sybase, Hana, ...) seems to always cause all scopes to be distributed; some other data-providers will go to distributed if opening, closing, reopening a connection in the scope, while others will not; ...) Le vendredi 29 juin 2018 02:20:12 UTC+2, Sravan Kumar 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> > > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nhusers/1a69cf5b-84c1-4783-ab24-8d36cd8e6eff%40googlegroups.com.
