zerodds-corba-cos-transactions

CORBA stack. OMG Object Transaction Service (OTS, CosTransactions) 1.4 (formal/2003-09-02): distributed transactions with two-phase commit.

zerodds-corba-cos-transactions brings distributed transactions into the CORBA model. A Coordinator holds the registered Resource participants and the transaction status, a Terminator ends the transaction and runs the two-phase commit, a Control gives access to both, and Current offers begin/commit/rollback bound to the calling context. In the prepare phase each resource votes Commit, Rollback or ReadOnly; a single Rollback rolls back every prepared resource. Read-only resources are skipped in phase 2, and with exactly one resource the prepare phase is skipped (one-phase commit). The transaction context travels as a CDR-encapsulated PropagationContext in the IOP service context TransactionService (id 0). The crate sends the form the OTS specification defines; on receipt it also accepts the form JacORB sends, in which the context is wrapped in an any (a TypeCode ahead of the value). Coordinator and terminator references are carried as opaque IOR bytes; empty bytes encode a nil reference. For durability, TransactionLog abstracts the log (the application supplies a file or database implementation; InMemoryLog is bundled). The commit decision is written before phase 2; after a restart, RecoveryCoordinator drives in-doubt transactions to the logged decision and treats unknown or incomplete ones as presumed-abort.

  • otid — Otid (otid_t) with its CDR codec.
  • propagation — PropagationContext, TransIdentity, TRANSACTION_SERVICE_CONTEXT_ID.
  • two_phase — Resource, Vote, HeuristicOutcome, coordinate_commit.
  • transaction — Current, Control, Coordinator, Terminator, Status.
  • recovery — TransactionLog, InMemoryLog, RecoveryCoordinator, coordinate_commit_durable.

Spec anchors

  • OMG Transaction Service 1.4 Appendix A (otid_t), §10.3.2 (Status, Resource, votes, heuristic outcomes), §10.3.3 (Control), §10.3.4 (Coordinator), §10.3.5 (Terminator), §10.3.6 (Current), §10.3.7 (RecoveryCoordinator, log), §10.4.6 (PropagationContext, service context id 0).
  • OMG CORBA 3.3 Part 2 §15.3.5.1 (TypeCode, skipped when reading the any-wrapped form).
  • Coverage: zerodds-corba-cos-transactions-1.0.

Consumers

  • No workspace crate uses it as a regular dependency.
  • Dev-dependency of zerodds-corba-giop (end-to-end test of a transactional invocation over TCP), zerodds-corba-ccm and zerodds-corba-interop (decoding of the PropagationContext JacORB puts into service context id 0).

Features

  • std (default) — enables alloc and zerodds-corba-rt/std.
  • alloc — enables zerodds-corba-rt/alloc.
  • Both features only pass through to zerodds-corba-rt; no code in src/ is gated by them.

Status

  • #![no_std] with alloc.
  • forbid(unsafe_code).
  • Library only, no binaries. Dependencies: zerodds-wire (CDR reader and writer), zerodds-corba-rt (TCKind).
  • 30 test functions in src/, 6 in tests/: ots_distributed.rs (a transaction over two account resources) and jacorb_live_capture.rs (decodes a 628-byte PropagationContext captured from JacORB 3.9, stored as a hex constant).

zerodds-corba-cos-transactions

CORBA-Stack. OMG Object Transaction Service (OTS, CosTransactions) 1.4 (formal/2003-09-02): verteilte Transaktionen mit Zwei-Phasen-Commit.

zerodds-corba-cos-transactions bringt verteilte Transaktionen in das CORBA-Modell. Ein Coordinator hält die registrierten Teilnehmer (Resource) und den Transaktionsstatus, ein Terminator beendet die Transaktion und führt den Zwei-Phasen-Commit aus, ein Control gibt Zugriff auf beide, und Current bietet begin/commit/rollback gebunden an den aufrufenden Kontext. In der Vorbereitungsphase (prepare) stimmt jede Ressource mit Commit, Rollback oder ReadOnly; ein einziges Rollback setzt alle vorbereiteten Ressourcen zurück. Ressourcen ohne Änderungen werden in Phase 2 übersprungen, und bei genau einer Ressource entfällt die Vorbereitungsphase (One-Phase-Commit). Der Transaktionskontext wird als CDR-gekapselter PropagationContext im IOP-Service-Context TransactionService (id 0) übertragen. Das Crate sendet die Form, die die OTS-Spezifikation festlegt; beim Empfang akzeptiert es zusätzlich die Form, die JacORB sendet und in der der Kontext in ein any verpackt ist (ein TypeCode vor dem Wert). Referenzen auf Coordinator und Terminator werden als undurchsichtige IOR-Bytes getragen; leere Bytes stehen für eine Nil-Referenz. Für die Dauerhaftigkeit abstrahiert TransactionLog das Protokoll (die Anwendung liefert eine Implementierung auf Datei oder Datenbank; InMemoryLog liegt bei). Die Entscheidung über den Commit wird vor Phase 2 geschrieben; nach einem Neustart führt RecoveryCoordinator unentschiedene Transaktionen zur protokollierten Entscheidung und behandelt unbekannte oder unvollständige als Presumed-Abort.

  • otid — Otid (otid_t) mit CDR-Codec.
  • propagation — PropagationContext, TransIdentity, TRANSACTION_SERVICE_CONTEXT_ID.
  • two_phase — Resource, Vote, HeuristicOutcome, coordinate_commit.
  • transaction — Current, Control, Coordinator, Terminator, Status.
  • recovery — TransactionLog, InMemoryLog, RecoveryCoordinator, coordinate_commit_durable.

Spec-Anker

  • OMG Transaction Service 1.4 Appendix A (otid_t), §10.3.2 (Status, Resource, Stimmen, heuristische Ergebnisse), §10.3.3 (Control), §10.3.4 (Coordinator), §10.3.5 (Terminator), §10.3.6 (Current), §10.3.7 (RecoveryCoordinator, Protokoll), §10.4.6 (PropagationContext, Service-Context id 0).
  • OMG CORBA 3.3 Part 2 §15.3.5.1 (TypeCode, wird beim Lesen der in any verpackten Form übersprungen).
  • Abdeckung: zerodds-corba-cos-transactions-1.0.

Konsumenten

  • Kein Crate im Workspace nutzt es als reguläre Abhängigkeit.
  • Entwicklungsabhängigkeit von zerodds-corba-giop (Ende-zu-Ende-Test eines transaktionalen Aufrufs über TCP), zerodds-corba-ccm und zerodds-corba-interop (Dekodierung des PropagationContext, den JacORB in Service-Context id 0 legt).

Features

  • std (Standard) — aktiviert alloc und zerodds-corba-rt/std.
  • alloc — aktiviert zerodds-corba-rt/alloc.
  • Beide Features werden nur an zerodds-corba-rt weitergereicht; kein Code in src/ hängt an ihnen.

Status

  • #![no_std] mit alloc.
  • forbid(unsafe_code).
  • Nur Bibliothek, keine Binaries. Abhängigkeiten: zerodds-wire (Reader/Writer für CDR), zerodds-corba-rt (TCKind).
  • 30 Testfunktionen in src/, 6 in tests/: ots_distributed.rs (eine Transaktion über zwei Konto-Ressourcen) und jacorb_live_capture.rs (dekodiert einen 628 Byte langen PropagationContext, aufgezeichnet aus JacORB 3.9, als Hex-Konstante abgelegt).