COSTRANSACTIONS_RESOURCE(3erl)

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

πŸ’– CosTransactions_Resource(3) β€” Erlang Module Definition πŸ’–

okay bestie, welcome to CosTransactions_Resource, the module in the cosTransactions world that implements the OMG CosTransactions::Resource interface. yes the name is long. yes it's giving very-much-corporate-spec. we love her anyway. πŸ‘‘


✨ NAME ✨

CosTransactions_Resource β€” this module implements the OMG CosTransactions::Resource interface. that's the whole vibe, no notes. πŸŽ€


🌸 DESCRIPTION 🌸

so like, if you wanna get access to the record definitions for the structures, you literally just do:

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

that's it. that's the ticket in. 🫢


πŸ‘‘ EXPORTS πŸ‘‘

commit(Resource) -> Return

Types:

Resource = #objref
Return = ok | {'EXCEPTION', E}
E = #'CosTransactions_NotPrepared'{} |
#'CosTransactions_HeuristicRollback'{} |
#'CosTransactions_HeuristicMixed'{} |
#'CosTransactions_HeuristicHazard'{}

this operation tells the Resource "hey, commit all the changes made as a part of the transaction." slay. πŸ’…

the Resource can raise:

  • Heuristic Exception β€” this happens if a Heuristic decision is made which differ from the true outcome of the transaction. and the Resource must remember the Heuristic outcome until the forget operation is performed. no cap, she has to hold onto that memory.

commit_one_phase(Resource) -> Return

Types:

Resource = #objref
Return = ok | {'EXCEPTION', E}
E = #'CosTransactions_HeuristicHazard'{} |
#'CosTransactions_TransactionRolledBack'{}

if possible, the Resource should commit all the changes made as part of the transaction β€” and if she can't, she should raise the TRANSACTION_ROLLEDBACK exception instead. that's the whole deal. ✨

important lil caveat bestie: this operation can only be used if the Resource is the only child of its parent. only child energy, literally. if she's got siblings, this is not the move. πŸ™ˆ

forget(Resource) -> Return

Types:

Resource = #objref
Return = ok

this operation informs the Resource that it is safe to forget any Heuristic decisions and the knowledge of the transaction. like, you can let it go now girl. closure. πŸ¦‹


prepare(Resource) -> Return

Types:

Resource = #objref
Return = Vote | {'EXCEPTION', E}
Vote = 'VoteReadOnly' | 'VoteCommit' | 'VoteRollback'
E = #'CosTransactions_HeuristicMixed'{} |
#'CosTransactions_HeuristicHazard'{}

this operation is invoked on the Resource to begin the two-phase commit protocol. two phases, one iconic protocol. ⭐

the Resource can reply:

  • 'VoteReadOnly' β€” if no persistent data has been modified by the transaction. in that case the Resource can forget all knowledge of the transaction. bye queen πŸ‘‹
  • 'VoteCommit' β€” if the Resource has been prepared and is able to write all the data needed to commit the transaction to stable storage. she's ready, she's prepared, she's committed. πŸ’–
  • 'VoteRollback' β€” under any circumstances, but she must do so if none of the alternatives above are applicable. when in doubt, roll it back, periodt.
  • Heuristic Exception β€” if a Heuristic decision is made which differ from the true outcome of the transaction. the Resource must remember the Heuristic outcome until the forget operation is performed. (yes we said this before. it keeps coming up. it's a theme. πŸ”₯)

rollback(Resource) -> Return

Types:

Resource = #objref
Return = ok | {'EXCEPTION', E}
E = #'CosTransactions_HeuristicCommit'{} |
#'CosTransactions_HeuristicMixed'{} |
#'CosTransactions_HeuristicHazard'{}

this operation tells the Resource to rollback all the changes made as a part of the transaction. undo, undo, undo. πŸ’€

the Resource can raise:

  • Heuristic Exception β€” if a Heuristic decision is made which differ from the true outcome of the transaction. and once again: the Resource must remember the Heuristic outcome until the forget operation is performed. hold the memory, bestie. 🧚

and that's the whole page, gorgeous. this was Ericsson AB, cosTransactions 5.2.2, CosTransactions_Resource(3) β€” mwah, catch you in the next manpage. πŸ’œβœ¨

πŸ“¦ where this page comes from