TM handler of exceptions

TM handler of exceptions

The manual indicates that the TMhandler commits the transaction and rethrows the exception to other handlers. What ifit doesn't commit successfully?Does it abort the transaction? If so,does it still rethrow the exception or just ignore it? And does it retry the transaction?


2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

In general, rules for commit are the same no matter whether this commit from usual code or exception handler: if commit fails the entire transaction is retried just as it was not executed at all.

For exception handler this means the follwoing: if commit fails, transaction will be retried from the beginning pretending that it was not executed, so exception will be abandoned as it were not happened at all.

Exception will reach handler outside transaction if only commit in TMhandler at transaction boundary succeeds. Otherwiseexternal handler would see inconsistent state: unchanged local data (reverted due to abort), but exception, potentially based onchanged data, is caught.

Serge Preis.

Leave a Comment

Please sign in to add a comment. Not a member? Join today