#include "config.h"#include "lixa_errors.h"#include "lixa_trace.h"#include "liblixapq.h"#include "xta_postgresql_xa_resource.h"
Go to the source code of this file.
Macros | |
| #define | LIXA_TRACE_MODULE LIXA_TRACE_MOD_XTA |
Functions | |
| int | xta_postgresql_xa_close (xta_xa_resource_t *context, char *xa_info, int rmid, long flags) |
| int | xta_postgresql_xa_commit (xta_xa_resource_t *context, const XID *xid, int rmid, long flags) |
| int | xta_postgresql_xa_end (xta_xa_resource_t *context, const XID *xid, int rmid, long flags) |
| int | xta_postgresql_xa_forget (xta_xa_resource_t *context, const XID *xid, int rmid, long flags) |
| int | xta_postgresql_xa_open (xta_xa_resource_t *context, char *xa_info, int rmid, long flags) |
| int | xta_postgresql_xa_prepare (xta_xa_resource_t *context, const XID *xid, int rmid, long flags) |
| int | xta_postgresql_xa_recover (xta_xa_resource_t *context, XID *xids, long count, int rmid, long flags) |
| void | xta_postgresql_xa_resource_clean (xta_postgresql_xa_resource_t *xa_resource) |
| void | xta_postgresql_xa_resource_delete (xta_postgresql_xa_resource_t *xa_resource) |
| int | xta_postgresql_xa_resource_init (xta_postgresql_xa_resource_t *xa_resource, PGconn *connection, const char *name, const char *open_info) |
| xta_postgresql_xa_resource_t * | xta_postgresql_xa_resource_new (PGconn *connection, const char *name, const char *open_info) |
| int | xta_postgresql_xa_rollback (xta_xa_resource_t *context, const XID *xid, int rmid, long flags) |
| int | xta_postgresql_xa_start (xta_xa_resource_t *context, const XID *xid, int rmid, long flags) |
Variables | |
| static const struct xta_iface_s | xta_postgresql_iface |
| #define LIXA_TRACE_MODULE LIXA_TRACE_MOD_XTA |
Definition at line 45 of file xta_postgresql_xa_resource.c.
| int xta_postgresql_xa_close | ( | xta_xa_resource_t * | context, |
| char * | xa_info, | ||
| int | rmid, | ||
| long | flags | ||
| ) |
Close a Postgresql resource manager
| [in,out] | context | : XTA resource context |
| [in] | xa_info | : null-terminated character string that may contain instance-specific information for the resource manager |
| [in] | rmid | : an integer assigned by the transaction manager, uniquely identifies the called resource manager instance within the thread of control |
| [in] | flags | : TMNOFLAGS, future usage only |
Definition at line 260 of file xta_postgresql_xa_resource.c.
References XA_OK, and XAER_RMERR.
| int xta_postgresql_xa_commit | ( | xta_xa_resource_t * | context, |
| const XID * | xid, | ||
| int | rmid, | ||
| long | flags | ||
| ) |
Commit work done on behalf of a transaction branch
| [in,out] | context | : XTA resource context |
| [in] | xid | transaction identifier, XA spec |
| [in] | rmid | : an integer assigned by the transaction manager, uniquely identifies the called resource manager instance within the thread of control |
| [in] | flags | : TMONEPHASE or TMNOFLAGS |
Definition at line 449 of file xta_postgresql_xa_resource.c.
References XAER_RMERR.
| int xta_postgresql_xa_end | ( | xta_xa_resource_t * | context, |
| const XID * | xid, | ||
| int | rmid, | ||
| long | flags | ||
| ) |
End work performed on behalf of a transaction branch
| [in,out] | context | XTA resource context |
| [in] | xid | transaction identifier, XA spec |
| [in] | rmid | an integer assigned by the transaction manager, uniquely identifies the called resource manager instance within the thread of control |
| [in] | flags | only TMSUCCESS and TMFAIL can be passed to a Postgresql resource |
Definition at line 337 of file xta_postgresql_xa_resource.c.
References XAER_RMERR.
| int xta_postgresql_xa_forget | ( | xta_xa_resource_t * | context, |
| const XID * | xid, | ||
| int | rmid, | ||
| long | flags | ||
| ) |
Forget about a heuristically completed transaction branch
| [in,out] | context | : XTA resource context |
| [in] | xid | transaction identifier, XA spec |
| [in] | rmid | : an integer assigned by the transaction manager, uniquely identifies the called resource manager instance within the thread of control |
| [in] | flags | : TMNOFLAGS, future usage only |
Definition at line 523 of file xta_postgresql_xa_resource.c.
References XAER_RMERR.
| int xta_postgresql_xa_open | ( | xta_xa_resource_t * | context, |
| char * | xa_info, | ||
| int | rmid, | ||
| long | flags | ||
| ) |
Open a PostgreSQL resource manager
| [in,out] | context | : XTA resource context |
| [in] | xa_info | : null-terminated character string that may contain instance-specific information for the resource manager |
| [in] | rmid | : an integer assigned by the transaction manager, uniquely identifies the called resource manager instance within the thread of control |
| [in] | flags | : TMNOFLAGS, future usage only |
Definition at line 215 of file xta_postgresql_xa_resource.c.
References XA_OK, and XAER_RMERR.
| int xta_postgresql_xa_prepare | ( | xta_xa_resource_t * | context, |
| const XID * | xid, | ||
| int | rmid, | ||
| long | flags | ||
| ) |
Prepare to commit work done on behalf of a transaction branch
| [in,out] | context | : XTA resource context |
| [in] | xid | transaction identifier, XA spec |
| [in] | rmid | : an integer assigned by the transaction manager, uniquely identifies the called resource manager instance within the thread of control |
| [in] | flags | : TMNOFLAGS, future usage only |
Definition at line 412 of file xta_postgresql_xa_resource.c.
References XAER_RMERR.
| int xta_postgresql_xa_recover | ( | xta_xa_resource_t * | context, |
| XID * | xids, | ||
| long | count, | ||
| int | rmid, | ||
| long | flags | ||
| ) |
Obtain a list of prepared transaction branches from a resource manager
| [in,out] | context | : XTA resource context |
| [in] | xids | : an array into which the resource manager places XIDs for list of transaction branches that are currently in a prepared or heuristically completed state |
| [in] | count | : the maximum number of XIDs that fit into that array |
| [in] | rmid | : an integer assigned by the transaction manager, uniquely identifies the called resource manager instance within the thread of control |
| [in] | flags | : TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS |
Definition at line 486 of file xta_postgresql_xa_resource.c.
References XAER_RMERR.
| void xta_postgresql_xa_resource_clean | ( | xta_postgresql_xa_resource_t * | xa_resource | ) |
Clean the properties of a PostgreSQL XA Resource; this function must be called after xta_postgresql_xa_resource_init during object deletion to avoid memory leaks
| [in,out] | xa_resource | : PostgreSQL XA Resource object |
Definition at line 185 of file xta_postgresql_xa_resource.c.
References xta_xa_resource_s::act_rsrmgr_config, LIXA_RC_INTERNAL_ERROR, LIXA_RC_OK, xta_postgresql_xa_resource_t::xa_resource, and xta_acquired_xa_resource_clean().
Referenced by xta_postgresql_xa_resource_delete().
| void xta_postgresql_xa_resource_delete | ( | xta_postgresql_xa_resource_t * | xa_resource | ) |
Delete an object that represent a PostgreSQL XA Resource
| [in] | xa_resource | : PostgreSQL XA Resource |
Definition at line 111 of file xta_postgresql_xa_resource.c.
References LIXA_RC_INTERNAL_ERROR, LIXA_RC_OK, and xta_postgresql_xa_resource_clean().
| int xta_postgresql_xa_resource_init | ( | xta_postgresql_xa_resource_t * | xa_resource, |
| PGconn * | connection, | ||
| const char * | name, | ||
| const char * | open_info | ||
| ) |
Initialize the propeties of a PostgreSQL XA resource
| [in,out] | xa_resource | : PostgreSQL XA Resource object |
| [in] | connection | : to PostgreSQL already opened by the application program |
| [in] | name | : unique identifier of the resource |
| [in] | open_info | : unique description of the connection properties like network name/IP address, port, user/schema, etc. Only the first MAXINFOSIZE characters will be kept. |
Definition at line 141 of file xta_postgresql_xa_resource.c.
References xta_xa_resource_s::act_rsrmgr_config, xta_postgresql_xa_resource_t::connection, lixa_iface_set_xta(), LIXA_RC_INTERNAL_ERROR, LIXA_RC_OK, xta_postgresql_xa_resource_t::lssr, xta_postgresql_xa_resource_t::xa_resource, and xta_acquired_xa_resource_init().
Referenced by xta_postgresql_xa_resource_new().
| xta_postgresql_xa_resource_t* xta_postgresql_xa_resource_new | ( | PGconn * | connection, |
| const char * | name, | ||
| const char * | open_info | ||
| ) |
Create a new object to represent a PostgreSQL XA resource
| [in,out] | connection | to PostgreSQL already opened by the application program |
| [in] | name | : unique identifier of the resource |
| [in] | open_info | : unique description of the connection properties like network name/IP address, port, user/schema, etc. Only the first MAXINFOSIZE characters will be kept. |
Definition at line 69 of file xta_postgresql_xa_resource.c.
References LIXA_RC_G_TRY_MALLOC_ERROR, LIXA_RC_INTERNAL_ERROR, LIXA_RC_OK, and xta_postgresql_xa_resource_init().
| int xta_postgresql_xa_rollback | ( | xta_xa_resource_t * | context, |
| const XID * | xid, | ||
| int | rmid, | ||
| long | flags | ||
| ) |
Roll back work done on behalf of a transaction branch
| [in,out] | context | : XTA resource context |
| [in] | xid | transaction identifier, XA spec |
| [in] | rmid | : an integer assigned by the transaction manager, uniquely identifies the called resource manager instance within the thread of control |
| [in] | flags | : TMNOFLAGS, future usage only |
Definition at line 375 of file xta_postgresql_xa_resource.c.
References XAER_RMERR.
| int xta_postgresql_xa_start | ( | xta_xa_resource_t * | context, |
| const XID * | xid, | ||
| int | rmid, | ||
| long | flags | ||
| ) |
Start work on behalf of a transaction branch
| [in,out] | context | XTA resource context |
| [in] | xid | transaction identifier, XA spec |
| [in] | rmid | an integer assigned by the transaction manager, uniquely identifies the called resource manager instance within the thread of control |
| [in] | flags | only TMNOFLAGS can be passed to a Postgresql resource |
Definition at line 300 of file xta_postgresql_xa_resource.c.
References XAER_RMERR.
|
static |
Interface with XA function pointers
Definition at line 52 of file xta_postgresql_xa_resource.c.