![]() |
![]() |
![]() |
Dee Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
#include <dee.h> #define DEE_TRANSACTION_ERROR struct DeeTransaction; struct DeeTransactionClass; enum DeeTransactionError; gboolean dee_transaction_commit (DeeTransaction *self
,GError **error
); GQuark dee_transaction_error_quark (void
); DeeModel * dee_transaction_get_target (DeeTransaction *self
); gboolean dee_transaction_is_committed (DeeTransaction *self
); DeeModel * dee_transaction_new (DeeModel *target
);
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()
.
#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
typedef enum { DEE_TRANSACTION_ERROR_CONCURRENT_MODIFICATION = 1, DEE_TRANSACTION_ERROR_COMMITTED = 2 } DeeTransactionError;
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
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.
|
The transaction to retrieve the target model for |
Returns : |
The target model. [transfer none] |
gboolean dee_transaction_is_committed (DeeTransaction *self
);
Check if a DeeTransaction has been committed. This method is mainly for debugging and testing purposes.
|
The transaction to inspect |
Returns : |
TRUE if and only if dee_transaction_commit() has completed
successfully on the transaction. |
DeeModel * dee_transaction_new (DeeModel *target
);
|
The DeeModel the transaction applies against |
Returns : |
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]
|