/usr/share/gtk-doc/html/libgda-4.0/libgda-4.0-GdaXaTransaction.html is in libgda-4.0-doc 4.2.8-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GdaXaTransaction</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="GNOME Data Access 4 manual">
<link rel="up" href="connection.html" title="Connections & commands">
<link rel="prev" href="GdaTransactionStatus.html" title="GdaTransactionStatus">
<link rel="next" href="virtual_connection.html" title="Virtual connections">
<meta name="generator" content="GTK-Doc V1.17 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="GdaTransactionStatus.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="connection.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GNOME Data Access 4 manual</th>
<td><a accesskey="n" href="virtual_connection.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libgda-4.0-GdaXaTransaction.synopsis" class="shortcut">Top</a>
|
<a href="#libgda-4.0-GdaXaTransaction.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="libgda-4.0-GdaXaTransaction"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libgda-4.0-GdaXaTransaction.top_of_page"></a>GdaXaTransaction</span></h2>
<p>GdaXaTransaction — Distributed transaction manager</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="libgda-4.0-GdaXaTransaction.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">struct <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction">GdaXaTransaction</a>;
enum <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransactionError" title="enum GdaXaTransactionError">GdaXaTransactionError</a>;
struct <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransactionId" title="struct GdaXaTransactionId">GdaXaTransactionId</a>;
<a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="returnvalue">GdaXaTransaction</span></a> * <a class="link" href="libgda-4.0-GdaXaTransaction.html#gda-xa-transaction-new" title="gda_xa_transaction_new ()">gda_xa_transaction_new</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> format</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *global_transaction_id</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libgda-4.0-GdaXaTransaction.html#gda-xa-transaction-register-connection" title="gda_xa_transaction_register_connection ()">gda_xa_transaction_register_connection</a>
(<em class="parameter"><code><a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> *xa_trans</code></em>,
<em class="parameter"><code><a class="link" href="GdaConnection.html" title="GdaConnection"><span class="type">GdaConnection</span></a> *cnc</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *branch</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libgda-4.0-GdaXaTransaction.html#gda-xa-transaction-unregister-connection" title="gda_xa_transaction_unregister_connection ()">gda_xa_transaction_unregister_connection</a>
(<em class="parameter"><code><a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> *xa_trans</code></em>,
<em class="parameter"><code><a class="link" href="GdaConnection.html" title="GdaConnection"><span class="type">GdaConnection</span></a> *cnc</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libgda-4.0-GdaXaTransaction.html#gda-xa-transaction-begin" title="gda_xa_transaction_begin ()">gda_xa_transaction_begin</a> (<em class="parameter"><code><a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> *xa_trans</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libgda-4.0-GdaXaTransaction.html#gda-xa-transaction-commit" title="gda_xa_transaction_commit ()">gda_xa_transaction_commit</a> (<em class="parameter"><code><a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> *xa_trans</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> **cnc_to_recover</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libgda-4.0-GdaXaTransaction.html#gda-xa-transaction-rollback" title="gda_xa_transaction_rollback ()">gda_xa_transaction_rollback</a> (<em class="parameter"><code><a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> *xa_trans</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libgda-4.0-GdaXaTransaction.html#gda-xa-transaction-commit-recovered" title="gda_xa_transaction_commit_recovered ()">gda_xa_transaction_commit_recovered</a> (<em class="parameter"><code><a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> *xa_trans</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> **cnc_to_recover</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="libgda-4.0-GdaXaTransaction.html#gda-xa-transaction-id-to-string" title="gda_xa_transaction_id_to_string ()">gda_xa_transaction_id_to_string</a> (<em class="parameter"><code>const <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransactionId" title="struct GdaXaTransactionId"><span class="type">GdaXaTransactionId</span></a> *xid</code></em>);
<a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransactionId" title="struct GdaXaTransactionId"><span class="returnvalue">GdaXaTransactionId</span></a> * <a class="link" href="libgda-4.0-GdaXaTransaction.html#gda-xa-transaction-string-to-id" title="gda_xa_transaction_string_to_id ()">gda_xa_transaction_string_to_id</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *str</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="libgda-4.0-GdaXaTransaction.description"></a><h2>Description</h2>
<p>
The <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object acts as a distributed transaction manager: to make sure local transactions on several
connections (to possibly different databases and database types) either all succeed or all fail. For more information,
see the X/Open CAE document Distributed Transaction Processing: The XA Specification.
This document is published by The Open Group and available at
<a class="ulink" href="http://www.opengroup.org/public/pubs/catalog/c193.htm" target="_top">http://www.opengroup.org/public/pubs/catalog/c193.htm</a>.
</p>
<p>
The two phases commit protocol is implemented during the execution of a distributed transaction: modifications
made on any connection are first <span class="emphasis"><em>prepared</em></span> (which means that they are store in the database), and
if that phase succeeded for all the involved connections, then the <span class="emphasis"><em>commit</em></span> phase is executed
(where all the data previously stored during the <span class="emphasis"><em>prepare</em></span> phase are actually committed).
That second phase may actually fail, but the distributed transaction will still be considered as sucessfull
as the data stored during the <span class="emphasis"><em>prepare</em></span> phase can be committed afterwards.
</p>
<p>
A distributed transaction involves the following steps:
</p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><p>Create a <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object</p></li>
<li class="listitem"><p>Register the connections which will be part of the distributed transaction with that object
using <a class="link" href="libgda-4.0-GdaXaTransaction.html#gda-xa-transaction-register-connection" title="gda_xa_transaction_register_connection ()"><code class="function">gda_xa_transaction_register_connection()</code></a></p></li>
<li class="listitem"><p>Beging the distributed transaction using <a class="link" href="libgda-4.0-GdaXaTransaction.html#gda-xa-transaction-begin" title="gda_xa_transaction_begin ()"><code class="function">gda_xa_transaction_begin()</code></a></p></li>
<li class="listitem"><p>Work individually on each connection as normally (make modifications)</p></li>
<li class="listitem"><p>Commit the distributed transaction using <a class="link" href="libgda-4.0-GdaXaTransaction.html#gda-xa-transaction-commit" title="gda_xa_transaction_commit ()"><code class="function">gda_xa_transaction_commit()</code></a></p></li>
<li class="listitem"><p>Discard the <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object using <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a></p></li>
</ol></div>
<p>
</p>
</div>
<div class="refsect1">
<a name="libgda-4.0-GdaXaTransaction.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GdaXaTransaction"></a><h3>struct GdaXaTransaction</h3>
<pre class="programlisting">struct GdaXaTransaction {
GObject object;
GdaXaTransactionPrivate *priv;
};
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="GdaXaTransactionError"></a><h3>enum GdaXaTransactionError</h3>
<pre class="programlisting">typedef enum
{
GDA_XA_TRANSACTION_ALREADY_REGISTERED_ERROR,
GDA_XA_TRANSACTION_DTP_NOT_SUPPORTED_ERROR,
GDA_XA_TRANSACTION_CONNECTION_BRANCH_LENGTH_ERROR
} GdaXaTransactionError;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="GdaXaTransactionId"></a><h3>struct GdaXaTransactionId</h3>
<pre class="programlisting">struct GdaXaTransactionId {
guint32 format; /* any number */
gushort gtrid_length; /* 1-64 */
gushort bqual_length; /* 1-64 */
char data [128];
};
</pre>
<p>
Distributed transaction identification, composed of a global format identifier, a global transaction identifier, and a
branch qualifier. For any connection participating in the global transaction, the format and global transaction identifier
should be the same, and the branch qualifier should vary between the connections.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> <em class="structfield"><code><a name="GdaXaTransactionId.format"></a>format</code></em>;</span></p></td>
<td>Format ID, should be 0 if OSI CCR naming is used, otherwise any positive integer</td>
</tr>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gushort"><span class="type">gushort</span></a> <em class="structfield"><code><a name="GdaXaTransactionId.gtrid-length"></a>gtrid_length</code></em>;</span></p></td>
<td>length of the global transaction ID (1-64)</td>
</tr>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gushort"><span class="type">gushort</span></a> <em class="structfield"><code><a name="GdaXaTransactionId.bqual-length"></a>bqual_length</code></em>;</span></p></td>
<td>length of the branch qualification (1-64)</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">char</span> <em class="structfield"><code><a name="GdaXaTransactionId.data"></a>data</code></em>[128];</span></p></td>
<td>concatenated global transaction ID (bytes 0 to (<em class="parameter"><code>gtrid_length</code></em> -1) included) and branch qualification (bytes <em class="parameter"><code>gtrid_length</code></em> to (<em class="parameter"><code>gtrid_length</code></em>+<em class="parameter"><code>bqual_length</code></em> - 1) included)</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-xa-transaction-new"></a><h3>gda_xa_transaction_new ()</h3>
<pre class="programlisting"><a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="returnvalue">GdaXaTransaction</span></a> * gda_xa_transaction_new (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> format</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *global_transaction_id</code></em>);</pre>
<p>
Creates a new <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object, which will control the process of
performing a distributed transaction across several connections.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
<td>a format ID</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>global_transaction_id</code></em> :</span></p></td>
<td>the global transaction ID</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the newly created object. <span class="annotation">[<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-xa-transaction-register-connection"></a><h3>gda_xa_transaction_register_connection ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gda_xa_transaction_register_connection
(<em class="parameter"><code><a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> *xa_trans</code></em>,
<em class="parameter"><code><a class="link" href="GdaConnection.html" title="GdaConnection"><span class="type">GdaConnection</span></a> *cnc</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *branch</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Registers <em class="parameter"><code>cnc</code></em> to be used by <em class="parameter"><code>xa_trans</code></em> to create a distributed transaction.
</p>
<p>
Note: any <a class="link" href="GdaConnection.html" title="GdaConnection"><span class="type">GdaConnection</span></a> object can only be registered with at most one <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object; also
some connections may not be registered at all with a <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object because the database
provider being used does not support it.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>xa_trans</code></em> :</span></p></td>
<td>a <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cnc</code></em> :</span></p></td>
<td>the connection to add to <em class="parameter"><code>xa_trans</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>branch</code></em> :</span></p></td>
<td>the branch qualifier</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>a place to store errors, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if no error occurred</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-xa-transaction-unregister-connection"></a><h3>gda_xa_transaction_unregister_connection ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> gda_xa_transaction_unregister_connection
(<em class="parameter"><code><a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> *xa_trans</code></em>,
<em class="parameter"><code><a class="link" href="GdaConnection.html" title="GdaConnection"><span class="type">GdaConnection</span></a> *cnc</code></em>);</pre>
<p>
Unregisters <em class="parameter"><code>cnc</code></em> to be used by <em class="parameter"><code>xa_trans</code></em> to create a distributed transaction. This is
the opposite of <a class="link" href="libgda-4.0-GdaXaTransaction.html#gda-xa-transaction-register-connection" title="gda_xa_transaction_register_connection ()"><code class="function">gda_xa_transaction_register_connection()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>xa_trans</code></em> :</span></p></td>
<td>a <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cnc</code></em> :</span></p></td>
<td>the connection to add to <em class="parameter"><code>xa_trans</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-xa-transaction-begin"></a><h3>gda_xa_transaction_begin ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gda_xa_transaction_begin (<em class="parameter"><code><a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> *xa_trans</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Begins a distributed transaction (managed by <em class="parameter"><code>xa_trans</code></em>). Please note that this phase may fail
for some connections if a (normal) transaction is already started (this depends on the database
provider being used), so it's better to avoid starting any (normal) transaction on any of the
connections registered with <em class="parameter"><code>xa_trans</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>xa_trans</code></em> :</span></p></td>
<td>a <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>a place to store errors, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>TRUE if no error occurred</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-xa-transaction-commit"></a><h3>gda_xa_transaction_commit ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gda_xa_transaction_commit (<em class="parameter"><code><a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> *xa_trans</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> **cnc_to_recover</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Commits a distributed transaction (managed by <em class="parameter"><code>xa_trans</code></em>). The commit is composed of two phases:
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>a PREPARE phase where all the connections are required to store their transaction data to a
permanent place (to be able to complete the commit should a problem occur afterwards)</p></li>
<li class="listitem"><p>a COMMIT phase where the transaction data is actually written to the database</p></li>
</ul></div>
<p>
</p>
<p>
If the PREPARE phase fails for any of the connection registered with <em class="parameter"><code>xa_trans</code></em>, then the distributed commit
fails and FALSE is returned. During the COMMIT phase, some commit may actually fail but the transaction can
still be completed because the PREPARE phase succeeded (through the recover method).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>xa_trans</code></em> :</span></p></td>
<td>a <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cnc_to_recover</code></em> :</span></p></td>
<td>a place to store the list of connections for which the commit phase failed, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>a place to store errors, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>TRUE if no error occurred (there may be some connections to recover, though)</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-xa-transaction-rollback"></a><h3>gda_xa_transaction_rollback ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gda_xa_transaction_rollback (<em class="parameter"><code><a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> *xa_trans</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Cancels a distributed transaction (managed by <em class="parameter"><code>xa_trans</code></em>).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>xa_trans</code></em> :</span></p></td>
<td>a <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>a place to store errors, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if no error occurred</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-xa-transaction-commit-recovered"></a><h3>gda_xa_transaction_commit_recovered ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gda_xa_transaction_commit_recovered (<em class="parameter"><code><a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> *xa_trans</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> **cnc_to_recover</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Tries to commit the data prepared but which failed to commit (see <a class="link" href="libgda-4.0-GdaXaTransaction.html#gda-xa-transaction-commit" title="gda_xa_transaction_commit ()"><code class="function">gda_xa_transaction_commit()</code></a>). This
method allows one to terminate a distributed transaction which succeeded but for which some
connections needed to be recovered.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>xa_trans</code></em> :</span></p></td>
<td>a <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cnc_to_recover</code></em> :</span></p></td>
<td>a place to store the list of connections for which the there were data to recover and which failed to be actually committed, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>a place to store errors, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if all the data which was still uncommitted has been committed</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-xa-transaction-id-to-string"></a><h3>gda_xa_transaction_id_to_string ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * gda_xa_transaction_id_to_string (<em class="parameter"><code>const <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransactionId" title="struct GdaXaTransactionId"><span class="type">GdaXaTransactionId</span></a> *xid</code></em>);</pre>
<p>
Creates a string representation of <em class="parameter"><code>xid</code></em>, in the format <gtrid>,<bqual>,<formatID> the
<gtrid> and <bqual> strings contain alphanumeric characters, and non alphanumeric characters
are converted to "<code class="literal">ab</code>" where ab is the hexadecimal representation of the character.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>xid</code></em> :</span></p></td>
<td>a <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransactionId" title="struct GdaXaTransactionId"><span class="type">GdaXaTransactionId</span></a> pointer</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new string representation of <em class="parameter"><code>xid</code></em>. <span class="annotation">[<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gda-xa-transaction-string-to-id"></a><h3>gda_xa_transaction_string_to_id ()</h3>
<pre class="programlisting"><a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransactionId" title="struct GdaXaTransactionId"><span class="returnvalue">GdaXaTransactionId</span></a> * gda_xa_transaction_string_to_id (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *str</code></em>);</pre>
<p>
Creates a new <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransactionId" title="struct GdaXaTransactionId"><span class="type">GdaXaTransactionId</span></a> structure from its string representation, it's the opposite
of <a class="link" href="libgda-4.0-GdaXaTransaction.html#gda-xa-transaction-id-to-string" title="gda_xa_transaction_id_to_string ()"><code class="function">gda_xa_transaction_id_to_string()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td>
<td>a string representation of a <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransactionId" title="struct GdaXaTransactionId"><span class="type">GdaXaTransactionId</span></a>, in the "gtrid,bqual,formatID" format</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="libgda-4.0-GdaXaTransaction.html#GdaXaTransactionId" title="struct GdaXaTransactionId"><span class="type">GdaXaTransactionId</span></a> structure, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> in <em class="parameter"><code>str</code></em> has a wrong format
Free-function: g_free</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.17</div>
</body>
</html>
|