Hi,<br><br><div class="gmail_quote">On Sun, Aug 16, 2009 at 11:43 AM, Maurice Gittens <span dir="ltr"><<a href="mailto:mainmanmauricio@gmail.com">mainmanmauricio@gmail.com</a>></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><snip><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("conn1", "a connection string for a postgres db"); // creates new connection<br>
txmon.add_connection("conn2", pqxxConnection1); // use existing connection<br><br> pqxx::transaction<pqxx::read_committed> tx(txmon, "a_tx_id");<br>
<br> // do stuff with the connections; <br> tx("conn1").exec("select * from pg_class;");<br><br><br> // a managed transaction does not have begin, commit, rollback methods<br> pqxx::managed_transaction mtx = txmon("conn2");<br>
mtx.exec("select 1")'<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>