Hi,<br><br><div class="gmail_quote">On Sun, Aug 16, 2009 at 11:43 AM, Maurice Gittens <span dir="ltr">&lt;<a href="mailto:mainmanmauricio@gmail.com">mainmanmauricio@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Jeroen,<br></blockquote><div><br>&lt;snip&gt;<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="gmail_quote"><div>I think we would want the API to align well with the mental-model used with<br>
XA compliant TM; keeping things nice and simple in the process.<br><br>A suggestion for integration into pqxx follows. (I have no idea if this suggestion<br>
aligns well with the pqxx design policies).<br><br>  pqxx::transaction_monitor txmon.<br>
<br>
  
txmon.add_connection(&quot;conn1&quot;, &quot;a connection string for a postgres db&quot;); // creates new connection<br>


   txmon.add_connection(&quot;conn2&quot;, pqxxConnection1); // use existing connection<br><br>  pqxx::transaction&lt;pqxx::read_committed&gt; tx(txmon, &quot;a_tx_id&quot;);<br>
<br>  // do stuff with the connections; <br>     tx(&quot;conn1&quot;).exec(&quot;select * from pg_class;&quot;);<br><br><br>  // a managed transaction does not have begin, commit, rollback methods<br>     pqxx::managed_transaction mtx = txmon(&quot;conn2&quot;);<br>

     mtx.exec(&quot;select 1&quot;)&#39;<br>    <br>  // do stuff more stuff<br>
   ...  <br></div></div></blockquote><div><br>The following statements are not correct ofcourse:<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="gmail_quote"><div><br>  tx.prepare();<br>  tx.commit();<br>
</div></div><br></blockquote><div><br>They should be replaced by: <br> <br>   txmon.prepare();<br>   txmon.commit();<br><br>Kind regards,<br>Maurice<br></div><br></div>