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.beginTransaction()
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 | 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. |