COSTRANSACTIONS_RECOVERYCOORDINATOR(3erl)

πŸ“¦
version 5.2.2 Β· 2 versions
, in fedora 43, fedora 44

✨ NAME ✨

CosTransactions_RecoveryCoordinator β€” bestie, this module implements the OMG CosTransactions::RecoveryCoordinator interface. That's it, that's the whole personality. πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

So like, to get access to the record definitions for the structures, you use this:

-include_lib("cosTransactions/include/CosTransactions.hrl").

No cap, that's the whole description section. Short and iconic. 🫢


🌸 EXPORTS 🌸

πŸ¦‹ replay_completion(RecoveryCoordinator, Timeout, Resource) -> Return πŸ¦‹

Types:

RecoveryCoordinator = #objref
Timeout = integer(), milliseconds | 'infinity'
Resource = #objref
Return = Status | {'EXCEPTION', E}
E = #'CosTransactions_NotPrepared'{}
Status = atom()

Okay so here's the tea β˜• β€” the RecoveryCoordinator object is the one that gets handed to you by the operation CosTransactions_Coordinator:register_resource/3. And replay_completion/2 may only be used by the registered Resource, and what it does is return the current status of the transaction. It's the move you pull when you're recovering after a failure. (Also yes, the page says /2 right there while the signature is /3 β€” iykyk, we do not ask questions, we simply report. πŸ™ˆ)

Possible Status replies, the whole roster:

  • 'StatusCommitted'
  • 'StatusCommitting'
  • 'StatusMarkedRollback'
  • 'StatusRollingBack'
  • 'StatusRolledBack'
  • 'StatusActive'
  • 'StatusPrepared'
  • 'StatusUnknown'
  • 'StatusNoTransaction'
  • 'StatusPreparing'

⚠️ Warning ⚠️

Not me being the bearer of bad news but: replay_completion/3 is blocking and may cause dead-lock if a child calls this function at the same time as its parent invokes an operation on the child. 😭

The good news? Dead-lock will not occur if the timeout has any value except 'infinity'. So like, don't be cute with 'infinity' here.

And one more thing fr fr: if the call is external incoming (intra-ORB), the timeout will not be activated. Which means β€” similar action must be taken if the Resource resides on another vendors ORB. πŸ‘‘ Protect your peace, protect your timeout.


k bye bestie, go forth and recover those transactions ✨ this page was brought to you by Ericsson AB, running cosTransactions version 5.2.2 β€” mwah, stay slay πŸ’–

πŸ“¦ where this page comes from