Skip to content

Commit 3073d96

Browse files
Fix a bad setting naming about transaction scopes
Additionally give more explicit guidance about the setting.
1 parent 067fc09 commit 3073d96

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

doc/reference/modules/transactions.xml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -644,16 +644,22 @@ finally
644644
<listitem>
645645
<para>
646646
As of NHibernate v5.0, <literal>FlushMode.Commit</literal> requires the configuration setting
647-
<literal>transaction.use_connection_on_system_events</literal> to be true for flushing
647+
<literal>transaction.use_connection_on_system_prepare</literal> to be true for flushing
648648
from transaction scope commit. Otherwise, it will be your responsibility to flush the session
649649
before completing the scope.
650650
</para>
651651
<para>
652-
Using <literal>transaction.use_connection_on_system_events</literal> can cause undesired
652+
Using <literal>transaction.use_connection_on_system_prepare</literal> can cause undesired
653653
transaction promotions to distributed: it requires using a dedicated connection for flushing,
654654
and it delays session disposal (if done inside the scope) to the scope disposal. If you want
655655
to avoid this, set this setting to <literal>false</literal> and manually flush your sessions.
656656
</para>
657+
<para>
658+
For new applications, it is recommended to set
659+
<literal>transaction.use_connection_on_system_prepare</literal> to <literal>false</literal>,
660+
and to flush explicitly your sessions before scope completion. For old applications, consider
661+
checking how sessions are flushed, and if possible switch it to <literal>false</literal> too.
662+
</para>
657663
</listitem>
658664
<listitem>
659665
<para>
@@ -669,7 +675,7 @@ finally
669675
<literal>Reconnect()</literal> before re-using the session.)
670676
</para>
671677
<para>
672-
When using <literal>transaction.use_connection_on_system_events</literal>, if the session is
678+
When using <literal>transaction.use_connection_on_system_prepare</literal>, if the session is
673679
disposed within the scope, the connection releasing will still occurs from transaction
674680
completion event.
675681
</para>
@@ -678,7 +684,7 @@ finally
678684
<para>
679685
As of NHibernate v5.0, using transaction scope and trying to use the session connection within
680686
<literal>AfterTransactionCompletion</literal> is forbidden and will raise an exception.
681-
If the setting <literal>transaction.use_connection_on_system_events</literal>
687+
If the setting <literal>transaction.use_connection_on_system_prepare</literal>
682688
is <literal>false</literal>, it will forbid any connection usage from
683689
<literal>BeforeTransactionCompletion</literal> event too, when this event is triggered by
684690
a transaction scope commit or rollback.

releasenotes.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
Build 5.2.0
2+
=============================
3+
4+
Release notes - NHibernate - Version 5.2.0
5+
6+
7+
As part of releasing 5.2.0, a misnamed setting in 5.0.0 release notes has been fixed:
8+
transaction.use_connection_on_system_events correct name is transaction.use_connection_on_system_prepare
9+
110
Build 5.1.3
211
=============================
312

@@ -383,7 +392,7 @@ Build 5.0.0
383392
* Transaction scopes handling has undergone a major rework. See NH-4011 for full details.
384393
** More transaction promotion to distributed may occur if you use the "flush on commit" feature with
385394
transaction scopes. Explicitly flush your session instead. Ensure it does not occur by disabling
386-
transaction.use_connection_on_system_events setting.
395+
transaction.use_connection_on_system_prepare setting.
387396
** After transaction events no more allow using the connection when they are raised from a scope
388397
completion.
389398
** Connection enlistment in an ambient transaction is now enforced by NHibernate by default.

0 commit comments

Comments
 (0)