1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright (C) 2024-2025 Greg Burd. Licensed under either of the
// Apache License, Version 2.0 or the MIT license, at your option.
// See LICENSE-APACHE and LICENSE-MIT at the root of this repository.
// SPDX-License-Identifier: Apache-2.0 OR MIT
//! > **Internal component of the [`noxu`](https://crates.io/crates/noxu) database.**
//! >
//! > This crate is published only so the `noxu` umbrella crate can depend on it.
//! > Use `noxu` (`noxu = "3"`) in applications; depend on this crate directly only
//! > if you are extending the engine internals. Its API may change without a major
//! > version bump.
//!
//! XA distributed transaction support for Noxu DB.
//!
//! This crate implements the X/Open XA interface for coordinating distributed
//! transactions across multiple Noxu environments. It provides:
//!
//! - `Xid` — XA transaction identifier (format_id + global_transaction_id + branch_qualifier)
//! - `XaFlags` — flags for XA operations (JOIN, RESUME, TMSUCCESS, ONEPHASE, etc.)
//! - `XaResource` — trait defining the XA resource manager interface
//! - `XaEnvironment` — implementation of `XaResource` backed by a Noxu Environment
//!
//! # Example
//!
//! ```ignore
//! use noxu_xa::{XaEnvironment, XaResource, Xid, XaFlags, PrepareResult};
//!
//! let xa = XaEnvironment::new(env);
//! let xid = Xid::new(1, b"global_txn_1", b"branch_1").unwrap();
//!
//! xa.xa_start(&xid, XaFlags::NOFLAGS)?;
//! // ... perform database operations using xa.get_transaction(&xid) ...
//! xa.xa_end(&xid, XaFlags::TMSUCCESS)?;
//!
//! match xa.xa_prepare(&xid, XaFlags::NOFLAGS)? {
//! PrepareResult::Ok => xa.xa_commit(&xid, XaFlags::NOFLAGS)?,
//! PrepareResult::ReadOnly => {} // no commit needed
//! }
//! ```
pub use XaEnvironment;
pub use ;
pub use XaFlags;
pub use PreparedLog;
pub use XaResource;
pub use ;