EntityTransaction
classin packageklyn.data
public final class EntityTransaction:
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
Properties
Modifier and Type Member Description
public readonly property active
active as Boolean:
Indicates whether this transaction has begun and has not completed.
public readonly property rollbackOnly
rollbackOnly as Boolean:
Indicates whether the active transaction can only be rolled back.
Constructors
Modifier and Type Member Description
public EntityTransaction
EntityTransaction( beginAction as Invocable<Void>, commitAction as Invocable<Void>, rollbackAction as Invocable<Void> ):
Creates a provider-neutral transaction delegate.
Methods
Modifier and Type Member Description
public begin
begin() as Void:
Begins a new provider transaction.
public commit
commit() as Void:
Flushes pending changes and commits the active transaction.
public markRollbackOnly
markRollbackOnly() as Void:
Prevents the active transaction from being committed.
public rollback
rollback() as Void:
Rolls back the active transaction and discards its pending work.