Skip to main content

TransactionError

Enum TransactionError 

Source
#[non_exhaustive]
pub enum TransactionError {
Show 25 variants ManagerMissing { datasource: String, }, ParallelInBlock { step: String, datasource: String, }, MulticastInBlock { step: String, datasource: String, }, WireTapInBlock { step: String, datasource: String, }, AsyncInBlock { step: String, datasource: String, }, SedaInBlock { step: String, datasource: String, }, StreamListInBlock { step: String, datasource: String, }, ForeignDatasource { step: String, block_datasource: String, step_datasource: String, }, UnnamedDatasource { step: String, }, NestedBlock { inner: String, }, SessionAborted { datasource: String, }, AbortedByHandledError { datasource: String, }, CommitUncertain { datasource: String, }, CommitFailed { datasource: String, reason: String, }, RollbackUncertain { datasource: String, }, PoolExhausted { datasource: String, max_connections: u32, waited_ms: u64, }, Timeout { datasource: String, elapsed_ms: u64, }, Busy { datasource: String, }, JoinSessionMissing { datasource: String, }, JoinScopeMismatch { datasource: String, expected_scope: u64, found_scope: u64, }, RuntimeSqlInJoinedStep { step: String, }, TransactionControlSql { step: String, statement: String, }, DialectUnprovable { scheme: String, }, UnsupportedJoinDialect { dialect: String, datasource: String, }, DynamicTargetUnprovable { step: String, },
}
Expand description

Typed transaction failures for load-time validation and runtime finalization.

Every variant names the offender (step or statement) and, where one exists, the datasource, so operators can discriminate programmatically. The variants map one-to-one onto the sql-transactions requirements named in each doc comment. #[non_exhaustive] lets slice 2 grow the family without a breaking change.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

ManagerMissing

No TransactionManager is registered for the block datasource.

Serves the requirement “Load-time validation is fail-closed and typed” (unknown datasource with no registered TransactionManager) and the requirement “TransactionManager port and registry resolution” (fail closed, named error).

Fields

§datasource: String

Datasource named by the transacted block.

§

ParallelInBlock

A parallel split reaches a joined sql step inside the block.

Serves the requirement “Load-time validation is fail-closed and typed”.

Fields

§step: String

The split step that escapes the transaction scope.

§datasource: String

Datasource of the enclosing transacted block.

§

MulticastInBlock

A multicast reaches a joined sql step inside the block.

Serves the requirement “Load-time validation is fail-closed and typed”.

Fields

§step: String

The multicast step that escapes the transaction scope.

§datasource: String

Datasource of the enclosing transacted block.

§

WireTapInBlock

A wire tap reaches a joined sql step inside the block.

Serves the requirement “Load-time validation is fail-closed and typed”.

Fields

§step: String

The wire-tap step that escapes the transaction scope.

§datasource: String

Datasource of the enclosing transacted block.

§

AsyncInBlock

An asynchronous producer handoff reaches a joined sql step inside the block.

Serves the requirement “Load-time validation is fail-closed and typed”.

Fields

§step: String

The step whose producer scheme hands the exchange to another task.

§datasource: String

Datasource of the enclosing transacted block.

§

SedaInBlock

A seda: handoff reaches a joined sql step inside the block.

Serves the requirement “Load-time validation is fail-closed and typed”.

Fields

§step: String

The step that hands the exchange to a seda queue.

§datasource: String

Datasource of the enclosing transacted block.

§

StreamListInBlock

A sql step produces a StreamList anywhere inside the block.

Rejected unconditionally (no consumer step needs to be present); serves the requirement “Load-time validation is fail-closed and typed”.

Fields

§step: String

The sql step producing the stream.

§datasource: String

Datasource of the enclosing transacted block.

§

ForeignDatasource

A sql step inside the block targets a different datasource.

Serves the requirement “Load-time validation is fail-closed and typed” (no 2PC across datasources).

Fields

§step: String

The sql step on the foreign datasource.

§block_datasource: String

Datasource of the enclosing transacted block.

§step_datasource: String

Datasource the offending sql step targets.

§

UnnamedDatasource

A sql step inside the block has no named datasource.

Inline db_url cannot join a block-owned transaction; serves the requirement “Load-time validation is fail-closed and typed”.

Fields

§step: String

The sql step missing the datasource parameter.

§

NestedBlock

A transacted block is nested inside another one.

Serves the requirement “Load-time validation is fail-closed and typed”.

Fields

§inner: String

Datasource of the inner (nested) block.

§

SessionAborted

Joined SQL was refused because the session is aborted.

Serves the requirement “Handled joined DB errors are rollback-only”: after the database aborted the transaction, no further statement may run.

Fields

§datasource: String

Datasource of the aborted session.

§

AbortedByHandledError

The block body returned Ok after a joined DB error was handled.

Serves the requirement “Handled joined DB errors are rollback-only”: the server may have aborted the transaction, so a commit path must never report Committed.

Fields

§datasource: String

Datasource of the rollback-only session.

§

CommitUncertain

A COMMIT acknowledgment was lost or unreadable.

Serves the requirement “Cancellation cutoff”: an unacknowledged COMMIT is reported as uncertain and never as a rollback.

Fields

§datasource: String

Datasource whose commit is uncertain.

§

CommitFailed

The database rejected the COMMIT.

Serves the requirement “Cancellation cutoff”: a rejected COMMIT is a typed failure, never a reported rollback.

Fields

§datasource: String

Datasource whose commit failed.

§reason: String

Driver-reported failure detail.

§

RollbackUncertain

A ROLLBACK could not be acknowledged.

Serves the requirement “Uncertain finalization detaches the connection”: the connection is discarded and the outcome is Detached.

Fields

§datasource: String

Datasource whose rollback is uncertain.

§

PoolExhausted

Connection acquisition exhausted the pool within the acquire deadline.

Serves the requirement “Pool exhaustion is bounded and named”.

Fields

§datasource: String

Datasource whose pool is exhausted.

§max_connections: u32

Configured pool size at the time of the failure.

§waited_ms: u64

Time spent waiting for a connection.

§

Timeout

Block execution exceeded its deadline.

Serves the requirement “Block timeout”.

Fields

§datasource: String

Datasource of the timed-out block.

§elapsed_ms: u64

Time elapsed before the deadline fired.

§

Busy

The session’s single execution slot is already held.

Serves the requirement “Busy block session” (at most one concurrent join per session).

Fields

§datasource: String

Datasource of the busy session.

§

JoinSessionMissing

A baked join has no transaction session to join at runtime.

Serves the requirement “Join semantics for sql steps on the block datasource”; the step must fail rather than auto-commit.

Fields

§datasource: String

Datasource the step expected to join.

§

JoinScopeMismatch

A baked join resolved to a different transaction scope at runtime.

Serves the requirement “Join semantics for sql steps on the block datasource”; scope membership is lexical, so a mismatch is a hard error.

Fields

§datasource: String

Datasource the step expected to join.

§expected_scope: u64

Scope id baked at load time.

§found_scope: u64

Scope id of the session actually found at runtime.

§

RuntimeSqlInJoinedStep

A joined sql step’s SQL comes from a runtime source (header/body/file).

Serves the requirement “Join semantics for sql steps on the block datasource”: a joined step’s SQL is static, route-configured text.

Fields

§step: String

The step whose SQL is not statically known.

§

TransactionControlSql

A joined sql step issues a transaction-control or implicit-commit statement.

Serves the requirement “Join semantics for sql steps on the block datasource” (BEGIN/COMMIT/ROLLBACK/SAVEPOINT and equivalents inside a joined step are rejected at load).

Fields

§step: String

The offending sql step.

§statement: String

The statement text that was rejected.

§

DialectUnprovable

The loader cannot prove the transaction semantics of a URL scheme.

Serves the requirement “Join semantics for sql steps on the block datasource”: dialect identity comes from the URL scheme, so an unrecognized scheme fails closed.

Fields

§scheme: String

URL scheme whose dialect could not be resolved.

§

UnsupportedJoinDialect

The resolved dialect does not support joined transactions in v1.

Serves the requirement “Join semantics for sql steps on the block datasource”: joined steps are PostgreSQL-only in v1.

Fields

§dialect: String

Resolved dialect name (e.g. mysql, sqlite).

§datasource: String

Datasource of the offending block.

§

DynamicTargetUnprovable

An in-block dynamic routing target was rejected at load.

Serves the requirement “Join semantics for sql steps on the block datasource”: a step whose destination is computed from the exchange (recipient list, routing slip, dynamic router) cannot prove block membership statically, so a transacted block containing one is rejected at load.

Fields

§step: String

The dynamic-routing step inside the block.

Trait Implementations§

Source§

impl Clone for TransactionError

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TransactionError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for TransactionError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for TransactionError

Source§

impl Error for TransactionError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Replaced by Error::source.
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<TransactionError> for CamelError

Source§

fn from(source: TransactionError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for TransactionError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TransactionError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more