MidgardTransaction

MidgardTransaction — Database single transaction.

Synopsis

#include <midgard/midgard.h>

struct              MidgardTransactionClass;
struct              MidgardTransaction;
MidgardTransaction * midgard_transaction_new            (MidgardConnection *mgd);
gboolean            midgard_transaction_begin           (MidgardTransaction *self);
gboolean            midgard_transaction_commit          (MidgardTransaction *self);
gboolean            midgard_transaction_rollback        (MidgardTransaction *self);
gboolean            midgard_transaction_get_status      (MidgardTransaction *self);
const gchar *       midgard_transaction_get_name        (MidgardTransaction *self);

Object Hierarchy

  GObject
   +----MidgardTransaction

Properties

  "connection"               MidgardConnection*    : Write / Construct Only

Description

Details

struct MidgardTransactionClass

struct MidgardTransactionClass {
	GObjectClass parent;

	/* class members */
	gboolean (*begin)		(MidgardTransaction *self);
	gboolean (*commit)		(MidgardTransaction *self);
	gboolean (*rollback)		(MidgardTransaction *self);
	gboolean (*get_status)		(MidgardTransaction *self);
	const gchar 	*(*get_name)		(MidgardTransaction *self);
};

Since 9.09


struct MidgardTransaction

struct MidgardTransaction;

Since 9.09


midgard_transaction_new ()

MidgardTransaction * midgard_transaction_new            (MidgardConnection *mgd);

mgd :

MidgardConnection instance

Returns :

New MidgardTransaction instance or NULL on failure

Since 9.09


midgard_transaction_begin ()

gboolean            midgard_transaction_begin           (MidgardTransaction *self);

Begins new, underlying database provider's transaction. In case of error, MidgardConnection error is set to MGD_ERR_INTERNAL.

self :

MidgardTransaction instance

Returns :

TRUE on success, FALSE otherwise.

Since 9.09


midgard_transaction_commit ()

gboolean            midgard_transaction_commit          (MidgardTransaction *self);

In case of error, MidgardConnection error is set to MGD_ERR_INTERNAL.

self :

MidgardTransaction instance

Returns :

TRUE on success, FALSE otherwise

Since 9.09


midgard_transaction_rollback ()

gboolean            midgard_transaction_rollback        (MidgardTransaction *self);

In case of error, MidgardConnection error is set to MGD_ERR_INTERNAL

self :

MidgardTransaction instance

Returns :

TRUE on success, FALSE otherwise.

Since 9.09


midgard_transaction_get_status ()

gboolean            midgard_transaction_get_status      (MidgardTransaction *self);

Returns transaction status. FALSE means, any transaction operation failed. No MidgardConnection error is set in case of error.

self :

MidgardTransaction instance

Returns :

TRUE on success, FALSE otherwise

Since 9.09


midgard_transaction_get_name ()

const gchar *       midgard_transaction_get_name        (MidgardTransaction *self);

self :

MidgardTransaction instance

Returns :

unique name which identifies given transaction.

Since 9.09

Property Details

The "connection" property

  "connection"               MidgardConnection*    : Write / Construct Only

Pointer to MidgardConnection, given object has been initialized for