maxon.GraphTransaction¶
Description¶
GraphModelInterface.BeginTransaction()
on the graph to modify.GraphTransaction.Commit()
to make them permanent,
or GraphTransaction.Rollback()
to return to the state of the graph
when GraphModelInterface.BeginTransaction()
has been called.Note
GraphTransaction.Commit()
or
GraphTransaction.Rollback()
hasn’t been called), a rollback is triggered implicitly by the destructor.Methods Signature¶
|
Commits (end ends) this transaction.
|
|
Returns the graph of this transaction, or a null reference when this transaction is inactive. |
|
Checks if this transaction is active.
|
|
Rolls back the graph to its state at the time this transaction has been started, and ends this transaction. |
|
|
|
|
|
Initializes a transaction. |
Methods Definition¶
-
GraphTransaction.
Commit
(userData=None)¶ - Commits (end ends) this transaction.The changes made within this transaction become permanent in the graph (unless this is a nested transaction and an enclosing transaction is rolled back later).If this transaction isn’t active, nothing happens.
- Parameters
userData (maxon.DataDictionary) –
User data to pass to the observers of GraphModelInterface.ObservableTransactionCommitted.This will be merged with all given user data of nested commits.
-
GraphTransaction.
GetGraph
()¶ Returns the graph of this transaction, or a null reference when this transaction is inactive.
- Return type
- Returns
Graph of transaction, or null reference.
-
GraphTransaction.
IsActive
()¶ - Checks if this transaction is active.A transaction is active between the initial call to
GraphModelInterface.BeginTransaction()
and the corresponding call toGraphModelInterface.Commit()
orGraphModelInterface.Rollback()
.- Return type
- Returns
True if this transaction is active otherwise False
-
GraphTransaction.
Rollback
()¶ Rolls back the graph to its state at the time this transaction has been started, and ends this transaction.
-
GraphTransaction.
__del__
()¶
-
GraphTransaction.
__enter__
()¶
-
GraphTransaction.
__exit__
(exc_type, exc_val, exc_tb)¶
-
GraphTransaction.
__init__
(src=None)¶ Initializes a transaction.
- Parameters
src (
maxon.GraphTransaction
) – An optional transaction to re-use.