Top | ![]() |
![]() |
![]() |
![]() |
gboolean | dee_transaction_commit () |
GQuark | dee_transaction_error_quark () |
DeeModel * | dee_transaction_get_target () |
gboolean | dee_transaction_is_committed () |
DeeModel * | dee_transaction_new () |
#define | DEE_TRANSACTION_ERROR |
struct | DeeTransaction |
struct | DeeTransactionClass |
enum | DeeTransactionError |
DeeTransaction is a self contained change set related to some particular DeeModel called the target model.
The transaction instance itself implements the DeeModel interface in a way
that overlays the target model. In database terms the target model has
isolation level READ_COMMITTED. Meaning that the target model is not modified
until you call dee_transaction_commit()
.
To flush the changes to the target model call dee_transaction_commit()
.
After committing the transaction will become invalid and must be freed with
g_object_unref()
. It is a programming error to try and access a transaction
that has been committed with the sole exception of calling
dee_transaction_is_committed()
.
gboolean dee_transaction_commit (DeeTransaction *self
,GError **error
);
Apply a transaction to its target model. After this call the transaction
is invalidated and must be freed with g_object_unref()
.
DeeModel *
dee_transaction_get_target (DeeTransaction *self
);
Get the target model of a transaction. This is just a convenience method for accessing the :target property.
gboolean
dee_transaction_is_committed (DeeTransaction *self
);
Check if a DeeTransaction has been committed. This method is mainly for debugging and testing purposes.
DeeModel *
dee_transaction_new (DeeModel *target
);
A newly allocated DeeTransaction. Free with g_object_unref()
when
done using it - no matter if you call dee_transaction_commit()
or not.
[transfer full][type Dee.Transaction]
#define DEE_TRANSACTION_ERROR dee_transaction_error_quark()
Error domain for the DeeTransaction. Error codes will be from the DeeTransactionError enumeration
struct DeeTransaction;
All fields in the DeeTransaction structure are private and should never be accessed directly
Error codes for the DeeTransaction class. These codes will be set when the error domain is DEE_TRANSACTION_ERROR.
DEE_TRANSACTION_ERROR_CONCURRENT_MODIFICATION
: The target model has been
modified while the transaction was open.
DEE_TRANSACTION_ERROR_COMMITTED
: Raised when someone tries to commit a
transaction that has already been committed