diff --git a/lang/lib/transaction.bal b/lang/lib/transaction.bal index 15a0f0f7..cbe8f945 100644 --- a/lang/lib/transaction.bal +++ b/lang/lib/transaction.bal @@ -14,13 +14,15 @@ // specific language governing permissions and limitations // under the License. + +# Type of error returned by commit action. +type Error distinct error; + # Information about a transaction that does not change # after the transaction is started. type Info readonly & record {| # Unique identifier for the transaction branch byte[] xid; - // non-zero means this transaction was a retry of - // a previous one # The number of previous attempts in a sequence of retries int retryNumber; # Information about the previous attempt in a sequence of retries. diff --git a/lang/spec.html b/lang/spec.html index bd0c8f6d..0e9b21e5 100644 --- a/lang/spec.html +++ b/lang/spec.html @@ -8736,7 +8736,7 @@
If the transaction manager decided to rollback, then the Commit operation -returns the error value for the cause of the rollback. Otherwise, it returns +returns the error value for the reason for the rollback. Otherwise, it returns nil.
@@ -8845,8 +8845,9 @@
Evaluating the commit-action
performs the transaction manager
Commit() operation; the result of this operation is the result of the
-commit-action
. Note that the commit action does not alter the flow
-of control.
+commit-action
. The type of the result is
+transaction:Error?
. Note that the commit action does not alter the
+flow of control.