Methods
# key(key) → {string}
Creates a prefixed reflection key for transaction-related metadata, ensuring proper namespacing
Generates a reflection metadata key for transactions
Parameters:
Name | Type | Description |
---|---|---|
key |
string
|
The base key to prefix with the transaction reflection namespace |
The complete reflection key for transaction metadata
string
# transactional(dataopt) → {function}
Sets a class async method as transactional, wrapping it in a transaction context that can be managed by the transaction system. This decorator handles transaction creation, binding, and error handling.
Method decorator that enables transactional behavior
sequenceDiagram
participant C as Client Code
participant D as Decorator
participant T as Transaction
participant O as Original Method
C->>D: Call decorated method
D->>D: Check if transaction exists in args
alt Transaction exists in args
D->>T: Create updated transaction
T->>T: Bind to original transaction
T->>T: Fire transaction
else No transaction
D->>T: Create new transaction
T->>T: Submit transaction
end
T->>O: Execute original method
O-->>T: Return result/error
T->>T: Release transaction
T-->>C: Return result/error
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
Array.<any>
|
<optional> |
Optional metadata available to the |
A decorator function that wraps the original method with transactional behavior
function