File 5272-mnesia-Improve-docs.patch of Package erlang

From c2284327b0e9443e41e9dad3b3a152e514b8c5e3 Mon Sep 17 00:00:00 2001
From: Dan Gudmundsson <dgud@erlang.org>
Date: Tue, 24 Jan 2023 16:21:35 +0100
Subject: [PATCH 2/4] mnesia: Improve docs

Specify that transactions should not containt side-effects
nor catch exits.
---
 lib/mnesia/doc/src/mnesia.xml | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/lib/mnesia/doc/src/mnesia.xml b/lib/mnesia/doc/src/mnesia.xml
index 13d2688ad1..729f5ebc03 100644
--- a/lib/mnesia/doc/src/mnesia.xml
+++ b/lib/mnesia/doc/src/mnesia.xml
@@ -2609,6 +2609,7 @@ mnesia:create_table(employee,
         </list>
       </desc>
     </func>
+
     <func>
       <name name="transaction" arity="1" since=""/>
       <name name="transaction" arity="2" clause_i="1" since=""/>
@@ -2674,13 +2675,20 @@ raise(Name, Amount) ->
           several processes running on different nodes can concurrently
           execute the function <c>raise/2</c> without interfering
           with each other.</p>
-        <p>Since Mnesia detects deadlocks, a transaction can be
-          restarted any number of times. This function attempts a
-          restart as specified in <c>Retries</c>. <c>Retries</c> must
-          be an integer greater than 0 or the atom <c>infinity</c>.
-          Default is <c>infinity</c>.</p>
+        <p>
+          Since Mnesia detects deadlocks, a transaction can be
+          restarted any number of times and therefore the <c>Fun</c> shall not
+          have any side effects such as waiting for specific messages.
+          This function attempts a restart as many times as specified in <c>Retries</c>.
+          <c>Retries</c> must be an integer greater than 0 or the atom <c>infinity</c>,
+          default is <c>infinity</c>.
+          Mnesia uses <c>exit</c> exceptions to signal that a transaction needs to be
+          restarted, thus a <c>Fun</c> must not catch <c>exit</c> exceptions with reason
+          <c>{aborted, term()}</c>.
+        </p>
       </desc>
     </func>
+
     <func>
       <name name="transform_table" arity="4" since=""/>
       <fsummary>Changes format on all records in table <c>Tab</c>.</fsummary>
-- 
2.35.3

openSUSE Build Service is sponsored by