cosTransactions(3)

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

πŸ’– cosTransactions πŸ’–

okay bestie, welcome to cosTransactions(3) β€” it's an Erlang Module Definition, and yes this is THE main module of the cosTransactions application. sit down, grab a boba, we're doing distributed transactions and we're doing them cutely. 🫢


✨ NAME ✨

cosTransactions β€” the main module of the cosTransactions application. that's it, that's the name, she's the main character of the whole app. πŸ‘‘


🌸 DESCRIPTION 🌸

so first things first, if you want the record definitions for the structures, you gotta include this:

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

no cap, do it or your structs simply will not exist. πŸ™ˆ

This module contains the functions for starting and stopping the application. If the application is started using application:start(cosTransactions) the default configuration is used (see listing below, bestie, it's right there). The Factory reference is stored using the CosNaming Service under the id "oe_cosTransactionsFac_IPNo". πŸ“Œ

The following application configuration parameters exist:

  • maxRetries β€” default is 40 times, i.e., if a transaction participant is unreachable the application will retry to contact it N times. Reaching the maximum is considered to be a disaster. 😭 like genuinely, disaster.
  • comFailWait β€” default is 5000 milliseconds, i.e., before the application retries to contact unreachable transaction participants the application wait Time milliseconds. she's just... waiting. patiently. πŸ’…

πŸ¦‹ EXPORTS πŸ¦‹

✨ start() -> Return ✨

Types:

Return = ok | {error, Reason}

This operation starts the cosTransactions application. go girl, boot up. πŸ”₯


✨ stop() -> Return ✨

Types:

Return = ok | {error, Reason}

This operation stops the cosTransactions application. bye bestie, rest well. 😴


✨ start_factory() -> TransactionFactory ✨

Types:

TransactionFactory = #objref

This operation creates a Transaction Factory. The Factory is used to create a new top-level transaction using default options (see listing below). it's giving "just use the defaults, she's fine". ✨


✨ start_factory(FacDef) -> TransactionFactory ✨

Types:

FacDef = [Options], see Option listing below.
TransactionFactory = #objref

This operation creates a Transaction Factory. The Factory is used to create a new top-level transaction.

The FacDef list must be a list of {Item, Value} tuples, where the following values are allowed:

  • {hash_max, HashValue} β€” This value denotes the upper bound of the hash value the Coordinator uses. Default is 1013. HashValue must be an integer. πŸ”’
  • {allow_subtr, Boolean} β€” If set to true it is possible to create subtransactions. Default is true. nesting hours, lowkey iconic. πŸͺ†
  • {typecheck, Boolean} β€” If set to to true all transaction operation's arguments will be type-checked. Default is true. (yes the original says "set to to", we don't fix, we respect. πŸ’€)
  • {tty, Boolean} β€” Enables or disables error printouts to the tty. If Flag is false, all text that the error logger would have sent to the terminal is discarded. If Flag is true, error messages are sent to the terminal screen. πŸ–₯️
  • {logfile, FileName} β€” This function makes it possible to store all system information in FileName (string()). It can be used in combination with the tty(false) item in to have a silent system, where all system information are logged to a file. As default no logfile is used. 🀫
  • {maxRetries, Integer} β€” default is 40 times, i.e., if a transaction participant is unreachable the application will retry to contact it N times. Reaching the maximum is considered to be a disaster. This option overrides the application configuration parameter. πŸ”
  • {comFailWait, Integer} β€” default is 5000 milliseconds, i.e., before the application retries to contact unreachable transaction participants the application wait Time milliseconds. This option overrides the application configuration parameter. ⏳

✨ stop_factory(TransactionFactory) -> Reply ✨

Types:

TransactionFactory = #objref
Reply = ok | {'EXCEPTION', E}

This operation stop the target transaction factory. (yes, "stop", not "stops" β€” we keep it exactly as she is, fr fr. πŸŽ€)

heads up bestie: that {'EXCEPTION', E} reply is real, so don't be out here assuming it's always ok. πŸ‘€

okay that's the whole page, you ate it, you understood it, you're basically a distributed transaction girlie now. πŸ’œβœ¨

sign-off time: this lil masterpiece is brought to you by Ericsson AB, running version cosTransactions 5.2.2 β€” and ngl the footer didn't hand me a date so we're not making one up, that's the rules. πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from