public final class EntityTransaction:
Transaction state owned by one EntityManager.
Provider work is delegated through callbacks created by the manager. This keeps transaction state provider-neutral while preserving a single public transaction API.
transaction = manager.transaction transaction.begin() try: manager.saveChanges() transaction.commit() catch error as Exception: transaction.rollback() throw error
| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | activeactive as Boolean: |
Indicates whether this transaction has begun and has not completed. |
| public readonly property | rollbackOnlyrollbackOnly as Boolean: |
Indicates whether the active transaction can only be rolled back. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | EntityTransactionEntityTransaction(
beginAction as Invocable<Void>,
commitAction as Invocable<Void>,
rollbackAction as Invocable<Void>
): |
Creates a provider-neutral transaction delegate. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | beginbegin() as Void: |
Begins a new provider transaction. |
| public | commitcommit() as Void: |
Flushes pending changes and commits the active transaction. |
| public | markRollbackOnlymarkRollbackOnly() as Void: |
Prevents the active transaction from being committed. |
| public | rollbackrollback() as Void: |
Rolls back the active transaction and discards its pending work. |