35 #include "lixa_trace.h"
36 #include "client_conn.h"
37 #include "client_config.h"
38 #include "client_status.h"
40 #include "lixa_syslog.h"
47 #ifdef LIXA_TRACE_MODULE
48 # undef LIXA_TRACE_MODULE
50 #define LIXA_TRACE_MODULE LIXA_TRACE_MOD_XTA
56 enum Exception { G_TRY_MALLOC_ERROR1
59 , CLIENT_CONFIG_DUP_ERROR
60 , CLIENT_CONFIG_DISPLAY_ERROR
61 , CLIENT_CONNECT_ERROR
62 , CLIENT_CONFIG_JOB_ERROR
67 LIXA_TRACE((
"xta_transaction_new\n"));
72 THROW(G_TRY_MALLOC_ERROR1);
74 this->already_opened = FALSE;
76 this->multiple_branches = FALSE;
78 if (NULL == (this->client_status =
79 g_try_malloc0(
sizeof(client_status_t))))
80 THROW(G_TRY_MALLOC_ERROR2);
82 client_status_init(this->client_status);
83 client_status_active(this->client_status);
86 if (NULL == (this->local_ccc =
87 g_try_malloc0(
sizeof(client_config_coll_t))))
88 THROW(G_TRY_MALLOC_ERROR3);
93 if (
LIXA_RC_OK != (ret_cod = client_config_dup(
94 &global_ccc, this->local_ccc)))
95 THROW(CLIENT_CONFIG_DUP_ERROR);
97 if (
LIXA_RC_OK != (ret_cod = client_config_display(this->local_ccc)))
98 THROW(CLIENT_CONFIG_DISPLAY_ERROR);
101 this->client_status, this->local_ccc))) {
102 LIXA_TRACE((
"xta_transaction_new/client_connect: ret_cod=%d "
104 THROW(CLIENT_CONNECT_ERROR);
107 if (
LIXA_RC_OK != (ret_cod = client_config_job(
108 this->local_ccc, client_status_get_sockfd(
109 this->client_status))))
110 THROW(CLIENT_CONFIG_JOB_ERROR);
114 this->commit_suspended = FALSE;
119 case G_TRY_MALLOC_ERROR1:
120 case G_TRY_MALLOC_ERROR2:
123 case CLIENT_CONFIG_DUP_ERROR:
124 case CLIENT_CONFIG_DISPLAY_ERROR:
125 case CLIENT_CONNECT_ERROR:
126 case CLIENT_CONFIG_JOB_ERROR:
137 LIXA_TRACE((
"xta_transaction_new: an internal error "
138 "occurred, releasing allocated memory...\n"));
139 if (excp > G_TRY_MALLOC_ERROR2) {
140 LIXA_TRACE((
"xta_transaction_new: releasing client "
141 "status objects...\n"));
143 client_status_free(this->client_status);
145 if (excp > CLIENT_CONFIG_DUP_ERROR) {
146 LIXA_TRACE((
"xta_transaction_new: releasing "
147 "configuration objects...\n"));
149 client_unconfig(this->local_ccc, FALSE);
151 if (excp > G_TRY_MALLOC_ERROR3) {
152 LIXA_TRACE((
"xta_transaction_new: an internal error "
153 "occurred, destroying local_ccc object and "
154 "returning NULL\n"));
156 g_free(this->local_ccc);
157 this->local_ccc = NULL;
159 if (excp > G_TRY_MALLOC_ERROR2) {
160 LIXA_TRACE((
"xta_transaction_new: an internal error "
161 "occurred, destroying client_status object and "
162 "returning NULL\n"));
164 g_free(this->client_status);
165 this->client_status = NULL;
167 if (excp > G_TRY_MALLOC_ERROR1) {
168 LIXA_TRACE((
"xta_transaction_new: an internal error "
169 "occurred, destroying this object and returning "
177 LIXA_TRACE((
"xta_transaction_new/excp=%d/"
178 "ret_cod=%d/errno=%d\n", excp, ret_cod, errno));
186 enum Exception { CLIENT_UNCONFIG_ERROR
190 LIXA_TRACE((
"xta_transaction_delete: destroying %p...\n", transact));
196 LIXA_TRACE((
"xta_transaction_delete/"
197 "xta_transaction_close_internal: ret_cod=%d\n",
201 if (
LIXA_RC_OK != (ret_cod = client_disconnect(
203 LIXA_TRACE((
"xta_transaction_delete/client_disconnect: "
204 "rec_cod=%d\n", ret_cod));
210 THROW(CLIENT_UNCONFIG_ERROR);
219 if (NULL != transact->
xid)
228 case CLIENT_UNCONFIG_ERROR:
237 LIXA_TRACE((
"xta_transaction_delete/excp=%d/"
238 "ret_cod=%d/errno=%d\n", excp, ret_cod, errno));
246 enum Exception { NULL_OBJECT
253 LIXA_TRACE((
"xta_transaction_safe_delete\n"));
257 if (NULL == transact)
259 txstate = client_status_get_txstate(transact->
client_status);
269 THROW(INVALID_STATUS);
276 THROW(INTERNAL_ERROR);
278 LIXA_TRACE((
"xta_transaction_safe_delete: status=%d, result=%d\n",
300 LIXA_TRACE((
"xta_transaction_safe_delete/excp=%d/"
301 "ret_cod=%d/errno=%d\n", excp, ret_cod, errno));
309 enum Exception { NULL_OBJECT
312 client_config_coll_t *ccc = NULL;
314 LIXA_TRACE((
"xta_transaction_get_config\n"));
316 if (NULL == transact)
333 LIXA_TRACE((
"xta_transaction_get_config/excp=%d/"
334 "ret_cod=%d/errno=%d\n", excp, ret_cod, errno));
343 enum Exception { NULL_OBJECT1
348 , CLIENT_CONFIG_DUP_ERROR
350 , XA_RESOURCE_REGISTERED
355 struct rsrmgr_config_s *rsrmgr = NULL;
356 struct act_rsrmgr_config_s act_rsrmgr;
358 LIXA_TRACE((
"xta_transaction_enlist_resource\n"));
361 if (NULL == transact)
367 if (TX_STATE_S0 != client_status_get_txstate(
369 LIXA_TRACE((
"xta_transaction_enlist_resource: expected client "
370 "status %d, current client status %d\n", TX_STATE_S0,
372 THROW(INVALID_STATUS);
382 if (NULL == (rsrmgr = g_try_malloc(
383 sizeof(
struct rsrmgr_config_s))))
384 THROW(G_TRY_MALLOC_ERROR);
388 if (
LIXA_RC_OK != (ret_cod = client_config_rsrmgr_dup(
389 config, rsrmgr, &act_rsrmgr)))
390 THROW(CLIENT_CONFIG_DUP_ERROR);
393 client_config_append_rsrmgr(transact->
local_ccc, rsrmgr,
399 THROW(REDIGEST_ERROR);
403 LIXA_TRACE((
"xta_transaction_enlist_resource: this is a static "
404 "resource, skipping config dup...\n"));
409 THROW(XA_RESOURCE_REGISTERED);
422 case G_TRY_MALLOC_ERROR:
427 case CLIENT_CONFIG_DUP_ERROR:
429 case XA_RESOURCE_REGISTERED:
438 if (NULL != rsrmgr) {
439 LIXA_TRACE((
"xta_transaction_enlist_resource: recoverying "
444 LIXA_TRACE((
"xta_transaction_enlist_resource/excp=%d/"
445 "ret_cod=%d/errno=%d\n", excp, ret_cod, errno));
454 enum Exception { NULL_OBJECT1
457 , G_CHECKSUM_NEW_ERROR
458 , G_CHECKSUM_GET_STRING_ERROR
459 , JOB_SET_SOURCE_IP_ERROR
462 gchar *config_tostring = NULL;
463 GChecksum *checksum = NULL;
464 client_config_coll_t *local_ccc = NULL;
466 LIXA_TRACE((
"xta_transaction_redigest\n"));
468 const gchar *checksum_string = NULL;
471 if (NULL == transact)
473 local_ccc = (client_config_coll_t *)transact->
local_ccc;
478 if (NULL == (config_tostring = client_config_tostring_rsrmgr(xrc)))
480 LIXA_TRACE((
"xta_transaction_redigest: config_tostring = '%s'\n",
483 LIXA_TRACE((
"xta_transaction_redigest: old digest is '%s'\n",
484 local_ccc->config_digest));
485 LIXA_TRACE((
"xta_transaction_redigest: old job id for this "
486 "transaction is '%s'\n",
489 if (NULL == (checksum = g_checksum_new(G_CHECKSUM_MD5)))
490 THROW(G_CHECKSUM_NEW_ERROR);
492 g_checksum_update(checksum, (guchar *)local_ccc->config_digest,
495 g_checksum_update(checksum, (guchar *)config_tostring,
496 strlen(config_tostring));
497 if (NULL == (checksum_string = g_checksum_get_string(checksum)))
498 THROW(G_CHECKSUM_GET_STRING_ERROR);
500 strncpy(local_ccc->config_digest,
508 client_status_get_sockfd(
510 THROW(JOB_SET_SOURCE_IP_ERROR);
512 LIXA_TRACE((
"xta_transaction_redigest: new digest is '%s'\n",
513 local_ccc->config_digest));
514 LIXA_TRACE((
"xta_transaction_redigest: new job id for this "
515 "transaction is '%s'\n",
526 case G_CHECKSUM_NEW_ERROR:
529 case G_CHECKSUM_GET_STRING_ERROR:
532 case JOB_SET_SOURCE_IP_ERROR:
541 if (NULL != config_tostring)
542 g_free(config_tostring);
543 if (NULL != checksum)
544 g_checksum_free(checksum);
546 LIXA_TRACE((
"xta_transaction_redigest/excp=%d/"
547 "ret_cod=%d/errno=%d\n", excp, ret_cod, errno));
562 enum Exception { NULL_OBJECT
569 LIXA_TRACE((
"xta_transaction_open_internal\n"));
571 int next_txstate, txrc;
574 if (NULL == transact)
577 if (TX_STATE_S0 != client_status_get_txstate(
579 LIXA_TRACE((
"xta_transaction_open_internal: expected client "
580 "status %d, current client status %d\n", TX_STATE_S0,
582 THROW(INVALID_STATUS);
584 next_txstate = TX_STATE_S1;
588 &txrc, next_txstate, FALSE)))
589 THROW(LIXA_XA_OPEN_ERROR);
592 client_status_set_txstate(transact->
client_status, next_txstate);
595 if (NULL != transact->
xid)
596 THROW(INTERNAL_ERROR);
607 case LIXA_XA_OPEN_ERROR:
619 LIXA_TRACE((
"xta_transaction_open_internal/excp=%d/"
620 "ret_cod=%d/errno=%d\n", excp, ret_cod, errno));
635 enum Exception { NULL_OBJECT
639 , LIXA_XA_CLOSE_ERROR
643 LIXA_TRACE((
"xta_transaction_close_internal\n"));
645 int txstate, next_txstate, txrc;
648 if (NULL == transact)
651 txstate = client_status_get_txstate(transact->
client_status);
654 LIXA_TRACE((
"xta_transaction_close_internal: already "
655 "close, skipping...\n"));
656 THROW(ALREADY_CLOSED);
660 THROW(PROTOCOL_ERROR);
664 THROW(INVALID_STATUS);
667 next_txstate = TX_STATE_S0;
672 THROW(LIXA_XA_CLOSE_ERROR);
676 client_status_set_txstate(transact->
client_status, next_txstate);
693 case LIXA_XA_CLOSE_ERROR:
702 LIXA_TRACE((
"xta_transaction_close_internal/excp=%d/"
703 "ret_cod=%d/errno=%d\n", excp, ret_cod, errno));
711 enum Exception { NULL_OBJECT
717 LIXA_TRACE((
"xta_transaction_recover\n"));
720 if (NULL == transact)
724 THROW(OPEN_INTERNAL);
727 THROW(CLOSE_INTERNAL);
745 LIXA_TRACE((
"xta_transaction_recover/excp=%d/"
746 "ret_cod=%d/errno=%d\n", excp, ret_cod, errno));
754 enum Exception { NULL_OBJECT1
756 , OPEN_INTERNAL_ERROR
759 , LIXA_XA_START_ERROR
763 LIXA_TRACE((
"xta_transaction_start\n"));
765 int txstate, next_txstate, dupid_or_proto = FALSE;
767 client_config_coll_t *local_ccc = NULL;
770 if (NULL == transact)
772 local_ccc = (client_config_coll_t *)transact->
local_ccc;
775 THROW(NON_REUSABLE_TX);
780 THROW(OPEN_INTERNAL_ERROR);
782 txstate = client_status_get_txstate(transact->
client_status);
783 if (TX_STATE_S1 != txstate) {
784 LIXA_TRACE((
"xta_transaction_start: expected client status %d, "
785 "current client status %d\n", TX_STATE_S1, txstate));
786 THROW(INVALID_STATUS);
788 next_txstate = TX_STATE_S3;
790 if (NULL == (transact->
xid =
xta_xid_new(local_ccc->config_digest,
800 next_txstate, &dupid_or_proto,
TMNOFLAGS)))
801 THROW(LIXA_XA_START_ERROR);
803 client_status_set_txstate(transact->
client_status, next_txstate);
811 case NON_REUSABLE_TX:
814 case OPEN_INTERNAL_ERROR:
822 case LIXA_XA_START_ERROR:
831 LIXA_TRACE((
"xta_transaction_start/excp=%d/"
832 "ret_cod=%d/errno=%d\n", excp, ret_cod, errno));
840 enum Exception { NULL_OBJECT
844 , LIXA_XA_PREPARE_WAIT_BRANCHES_ERROR
846 , LIXA_XA_PREPARE_ERROR
847 , LIXA_XA_COMMIT_ERROR
850 , LIXA_XA_ROLLBACK_ERROR
853 , LIXA_XA_FORGET_ERROR
858 LIXA_TRACE((
"xta_transaction_commit\n"));
861 int one_phase_commit = FALSE, commit = TRUE, finished = TRUE;
862 int txstate, prepare_txrc, next_txstate;
865 if (NULL == transact)
868 txstate = client_status_get_txstate(transact->
client_status);
869 if (TX_STATE_S3 != txstate) {
870 LIXA_TRACE((
"xta_transaction_commit: expected client status %d, "
871 "current client status %d\n", TX_STATE_S3, txstate));
872 THROW(INVALID_STATUS);
875 LIXA_TRACE((
"xta_transaction_commit: a previously suspended "
876 "commit must be completed\n"));
879 one_phase_commit = (client_status_could_one_phase(
882 if (one_phase_commit) {
885 if (NULL == (bqual = lixa_xid_get_bqual_ascii(
887 THROW(GET_BQUAL_ASCII);
889 LIXA_TRACE((
"xta_transaction_commit: forcing "
890 "one_phase_commit to FALSE because the branch "
891 "qualifier (%s) of this transaction is "
892 "related to a multiple branches transaction\n",
894 one_phase_commit = FALSE;
903 if (TX_ROLLBACK == txrc)
906 THROW(LIXA_XA_END_ERROR);
913 ret_cod = lixa_xa_prepare_wait_branches(
920 THROW(LIXA_XA_PREPARE_WAIT_BRANCHES_ERROR);
921 }
else if (!one_phase_commit) {
924 ret_cod = lixa_xa_prepare(
933 THROW(COMMIT_SUSPENDED);
940 THROW(LIXA_XA_PREPARE_ERROR);
947 LIXA_TRACE((
"xta_transaction_commit: go on with commit...\n"));
952 &txrc, one_phase_commit)))
953 THROW(LIXA_XA_COMMIT_ERROR);
960 next_txstate = TX_STATE_S1;
963 case TX_ROLLBACK_NO_BEGIN:
964 case TX_MIXED_NO_BEGIN:
965 case TX_HAZARD_NO_BEGIN:
966 THROW(INVALID_STATE1);
969 next_txstate = txstate;
973 THROW(INVALID_TXRC1);
976 LIXA_TRACE((
"xta_transaction_commit: go on with rollback...\n"));
977 if (
LIXA_RC_OK != (ret_cod = lixa_xa_rollback(
982 THROW(LIXA_XA_ROLLBACK_ERROR);
983 if (TX_FAIL == prepare_txrc) {
984 LIXA_TRACE((
"xta_transaction_commit: txrc=%d, "
986 "returning TX_FAIL to Application Program\n",
987 txrc, prepare_txrc));
990 LIXA_TRACE((
"xta_transaction_commit: txrc=%d\n", txrc));
996 next_txstate = TX_STATE_S1;
999 case TX_ROLLBACK_NO_BEGIN:
1000 case TX_MIXED_NO_BEGIN:
1001 case TX_HAZARD_NO_BEGIN:
1002 case TX_COMMITTED_NO_BEGIN:
1003 THROW(INVALID_STATE2);
1006 next_txstate = txstate;
1010 THROW(INVALID_TXRC2);
1018 THROW(LIXA_XA_FORGET_ERROR);
1021 client_status_set_txstate(transact->
client_status, next_txstate);
1031 case INVALID_STATUS:
1034 case GET_BQUAL_ASCII:
1037 case LIXA_XA_END_ERROR:
1038 case LIXA_XA_PREPARE_WAIT_BRANCHES_ERROR:
1039 case LIXA_XA_PREPARE_ERROR:
1040 case COMMIT_SUSPENDED:
1041 case LIXA_XA_COMMIT_ERROR:
1043 case INVALID_STATE1:
1047 case LIXA_XA_ROLLBACK_ERROR:
1049 case INVALID_STATE2:
1053 case LIXA_XA_FORGET_ERROR:
1081 if (NULL != bqual) {
1085 LIXA_TRACE((
"xta_transaction_commit/excp=%d/"
1086 "ret_cod=%d/errno=%d\n", excp, ret_cod, errno));
1094 enum Exception { NULL_OBJECT
1097 , LIXA_XA_ROLLBACK_ERROR
1100 , LIXA_XA_FORGET_ERROR
1104 LIXA_TRACE((
"xta_transaction_rollback\n"));
1107 int txstate, next_txstate, finished = TRUE;
1110 if (NULL == transact)
1113 txstate = client_status_get_txstate(transact->
client_status);
1114 if (TX_STATE_S3 != txstate) {
1115 LIXA_TRACE((
"xta_transaction_commit: expected client status %d, "
1116 "current client status %d\n", TX_STATE_S3, txstate));
1117 THROW(INVALID_STATUS);
1123 if (
LIXA_RC_OK != ret_cod && TX_ROLLBACK != txrc)
1124 THROW(LIXA_XA_END_ERROR);
1126 if (
LIXA_RC_OK != (ret_cod = lixa_xa_rollback(
1130 THROW(LIXA_XA_ROLLBACK_ERROR);
1137 next_txstate = TX_STATE_S1;
1140 case TX_MIXED_NO_BEGIN:
1141 case TX_HAZARD_NO_BEGIN:
1142 case TX_COMMITTED_NO_BEGIN:
1143 THROW(INVALID_STATE);
1146 next_txstate = txstate;
1150 THROW(INVALID_TXRC);
1157 THROW(LIXA_XA_FORGET_ERROR);
1160 client_status_set_txstate(transact->
client_status, next_txstate);
1170 case INVALID_STATUS:
1173 case LIXA_XA_END_ERROR:
1174 case LIXA_XA_ROLLBACK_ERROR:
1180 case LIXA_XA_FORGET_ERROR:
1202 LIXA_TRACE((
"xta_transaction_rollback/excp=%d/"
1203 "ret_cod=%d/errno=%d\n", excp, ret_cod, errno));
1211 enum Exception { NULL_OBJECT
1219 LIXA_TRACE((
"xta_transaction_suspend\n"));
1221 int txstate, next_txstate, txrc;
1224 if (NULL == transact)
1227 txstate = client_status_get_txstate(transact->
client_status);
1231 THROW(PROTOCOL_ERROR);
1235 THROW(INVALID_STATUS);
1239 LIXA_TRACE((
"xta_transaction_suspend: flags=TMMIGRATE, "
1240 "suspend for resume\n"));
1242 LIXA_TRACE((
"xta_transaction_suspend: flags=TMNOFLAGS, "
1243 "suspend for join\n"));
1245 THROW(INVALID_FLAGS);
1253 THROW(LIXA_XA_END_ERROR);
1255 next_txstate = TX_STATE_S5;
1257 client_status_set_txstate(transact->
client_status, next_txstate);
1265 case PROTOCOL_ERROR:
1268 case INVALID_STATUS:
1274 case LIXA_XA_END_ERROR:
1283 LIXA_TRACE((
"xta_transaction_suspend/excp=%d/"
1284 "ret_cod=%d/errno=%d\n", excp, ret_cod, errno));
1291 const char *xid_string,
long flags)
1293 enum Exception { NULL_OBJECT1
1295 , OPEN_INTERNAL_ERROR
1299 , LIXA_XA_START_ERROR
1303 LIXA_TRACE((
"xta_transaction_resume\n"));
1305 int txstate, next_txstate, dupid_or_proto = FALSE;
1309 if (NULL == transact || NULL == xid_string)
1310 THROW(NULL_OBJECT1);
1312 if (NULL != transact->
xid)
1313 THROW(INVALID_STATUS);
1318 THROW(OPEN_INTERNAL_ERROR);
1320 txstate = client_status_get_txstate(transact->
client_status);
1324 THROW(PROTOCOL_ERROR);
1329 THROW(PROTOCOL_ERROR);
1331 next_txstate = TX_STATE_S3;
1334 LIXA_TRACE((
"xta_transaction_resume: flags=TMRESUME, "
1335 "resuming after possible migration\n"));
1336 }
else if (
TMJOIN == flags) {
1337 LIXA_TRACE((
"xta_transaction_resume: flags=TMJOIN, "
1338 "joining an existent transaction\n"));
1340 THROW(INVALID_FLAGS);
1343 THROW(NULL_OBJECT2);
1349 next_txstate, &dupid_or_proto, flags)))
1350 THROW(LIXA_XA_START_ERROR);
1352 client_status_set_txstate(transact->
client_status, next_txstate);
1360 case INVALID_STATUS:
1363 case OPEN_INTERNAL_ERROR:
1365 case PROTOCOL_ERROR:
1374 case LIXA_XA_START_ERROR:
1383 LIXA_TRACE((
"xta_transaction_resume/excp=%d/"
1384 "ret_cod=%d/errno=%d\n", excp, ret_cod, errno));
1392 enum Exception { NULL_OBJECT1
1393 , OPEN_INTERNAL_ERROR
1400 , LIXA_XA_START_ERROR
1406 LIXA_TRACE((
"xta_transaction_branch\n"));
1408 XID superior, subordinate;
1410 int txstate, next_txstate, dupid_or_proto = FALSE;
1414 if (NULL == transact)
1415 THROW(NULL_OBJECT1);
1420 THROW(OPEN_INTERNAL_ERROR);
1422 txstate = client_status_get_txstate(transact->
client_status);
1423 if (TX_STATE_S1 != txstate) {
1424 LIXA_TRACE((
"xta_transaction_branch: expected client status %d, "
1425 "current client status %d\n", TX_STATE_S1, txstate));
1426 THROW(INVALID_STATUS);
1428 next_txstate = TX_STATE_S3;
1431 if (!lixa_xid_deserialize(&superior, xid_string)) {
1432 LIXA_TRACE((
"xta_transaction_branch: unable to deserialize "
1433 "superior XID '%s'\n", xid_string));
1434 THROW(XID_DESERIALIZE);
1437 if (NULL == (bqual = lixa_xid_get_bqual_ascii(&superior)))
1438 THROW(GET_BQUAL_ASCII);
1440 LIXA_TRACE((
"xta_transaction_branch: this transaction "
1441 "(xid=%s) can't be branched because bqual (%s) is "
1442 "related to a non branchable transaction\n",
1443 xid_string, bqual));
1444 LIXA_SYSLOG((LOG_ERR, LIXA_SYSLOG_LXC031E, xid_string, bqual));
1445 THROW(NON_BRANCHABLE_TX);
1448 lixa_xid_branch_new(&superior, &subordinate);
1450 if (!lixa_xid_serialize(&subordinate, lsx)) {
1451 LIXA_TRACE((
"xta_transaction_branch: unable to serialize "
1452 "subordinate XID\n"));
1453 THROW(XID_SERIALIZE);
1456 LIXA_TRACE((
"xta_transaction_branch: superior XID is '%s', "
1457 "subordinate XID is '%s'\n", xid_string, lsx));
1460 THROW(NULL_OBJECT2);
1475 THROW(LIXA_XA_START_ERROR);
1478 client_status_set_txstate(transact->
client_status, next_txstate);
1486 case OPEN_INTERNAL_ERROR:
1488 case INVALID_STATUS:
1491 case XID_DESERIALIZE:
1493 case GET_BQUAL_ASCII:
1496 case NON_BRANCHABLE_TX:
1502 case LIXA_XA_START_ERROR:
1512 if (NULL != bqual) {
1516 LIXA_TRACE((
"xta_transaction_branch/excp=%d/"
1517 "ret_cod=%d/errno=%d\n", excp, ret_cod, errno));
1525 enum Exception { NULL_OBJECT
1530 LIXA_TRACE((
"xta_transaction_get_xid\n"));
1532 if (NULL == transact)
1534 xid = transact->
xid;
1549 LIXA_TRACE((
"xta_transaction_get_xid/excp=%d/"
1550 "ret_cod=%d/errno=%d\n", excp, ret_cod, errno));
1559 enum Exception { NULL_OBJECT
1564 LIXA_TRACE((
"xta_transaction_get_multiple_branches\n"));
1566 if (NULL == transact)
1583 LIXA_TRACE((
"xta_transaction_get_multiple_branches/excp=%d/"
1584 "ret_cod=%d/errno=%d\n", excp, ret_cod, errno));
void xta_xid_delete(xta_xid_t *xid)
int xta_transaction_open_internal(xta_transaction_t *transact)
int xta_transaction_branch(xta_transaction_t *transact, const char *xid_string)
#define LIXA_RC_NULL_OBJECT
#define LIXA_RC_TX_HAZARD
#define LIXA_RC_INTERNAL_ERROR
int xta_transaction_open(xta_transaction_t *transact)
int xta_xid_branch_qualifier_is_multibranch(const char *branch_qualifier)
static const char * lixa_job_get_raw(const lixa_job_t *job)
xta_xid_t * xta_xid_new_from_XID(const XID *xid)
xta_xid_t * xta_xid_new(const char *branch_qualifier, int multiple_branches)
#define LIXA_RC_NO_SUPERIOR_BRANCH
static void lixa_job_set_config_digest(lixa_job_t *job, const char *config_digest)
xta_xid_t * xta_xid_new_from_string(const char *xid_string)
int xta_transaction_recover(xta_transaction_t *transact)
#define LIXA_RC_WOULD_BLOCK
char md5_digest_hex_t[MD5_DIGEST_LENGTH *2+1]
xta_transaction_client_status_t * client_status
const xta_xa_resource_config_t * xta_xa_resource_get_config(const xta_xa_resource_t *xa_resource)
const XID * xta_xid_get_xa_xid(const xta_xid_t *xid)
int xta_transaction_commit(xta_transaction_t *transact, int non_blocking)
const char * lixa_strerror(int ret_cod)
int xta_transaction_resume(xta_transaction_t *transact, const char *xid_string, long flags)
#define LIXA_RC_G_CHECKSUM_NEW_ERROR
int xta_transaction_safe_delete(const xta_transaction_t *transact)
#define LIXA_RC_NON_BRANCHABLE_TX
int xta_transaction_get_multiple_branches(const xta_transaction_t *transact)
#define LIXA_RC_G_TRY_MALLOC_ERROR
int xta_transaction_redigest(xta_transaction_t *transact, const xta_xa_resource_config_t *xrc)
int lixa_job_set_source_ip(lixa_job_t *job, int fd)
xta_config_t * xta_transaction_get_config(xta_transaction_t *transact)
static void lixa_job_reset(lixa_job_t *job)
#define LIXA_RC_G_CHECKSUM_GET_STRING_ERROR
struct act_rsrmgr_config_s xta_xa_resource_config_t
int xta_transaction_close_internal(xta_transaction_t *transact)
#define LIXA_RC_TX_ROLLBACK
static int xta_xa_resource_is_dynamic(const xta_xa_resource_t *xa_resource)
void xta_xid_reset(xta_xid_t *xid)
int xta_transaction_start(xta_transaction_t *transact, int multiple_branches)
#define LIXA_RC_PROTOCOL_ERROR
int xta_transaction_suspend(xta_transaction_t *transact, long flags)
int xta_transaction_close(xta_transaction_t *transact)
#define MD5_DIGEST_LENGTH
int xta_transaction_enlist_resource(xta_transaction_t *transact, xta_xa_resource_t *xa_res)
#define LIXA_RC_INVALID_OPTION
#define LIXA_RC_MALFORMED_XID
#define LIXA_RC_INVALID_STATUS
const xta_xid_t * xta_transaction_get_xid(const xta_transaction_t *transact)
#define LIXA_RC_NON_REUSABLE_TX
int xta_transaction_rollback(xta_transaction_t *transact)
void xta_transaction_delete(xta_transaction_t *transact)
xta_transaction_t * xta_transaction_new(void)
#define LIXA_RC_OTHER_BRANCH_ERROR
int xta_xa_resource_enlisted(xta_xa_resource_t *xa_resource, const xta_transaction_t *tx)