<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">It isn't unusual for serialisation errors to be reported prior to<br>
commit: the database usually reports them as soon as it detects the<br>
problem. The traceback from the error you saw probably tells you<br>
where it occurred. Try wrapping your try/except block around the<br>
entire transaction logic rather than just the commit() call.<br>
<br>
If you're using PostgreSQL, the<br>
psycopg2.extensions.TransactionRollbackError exception should cover<br>
the cases you're interested in.<br>
<div class="im"><br></div></blockquote><div><br>Yes you are correct, I got the exception now if I wrap the entire block. <br><br>Error I GOT YOU : could not serialize access due to concurrent update<br><br><class 'psycopg2.extensions.TransactionRollbackError'><br>
<br>Should I rollback and try again or just try to run the block again? It may not improve the performance as I have to do it all again <sigh><br><br>Thanks for your help<br><br><br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">
<br>
> The same problem with MySQL with innoDB (different error message though,<br>
> something abt deadlock detected<br>
<br>
</div>I would guess MySQL is pretty much the same: report the error as soon<br>
as the problem is detected rather than letting you continue until<br>
commit.<br>
<div class="im"><br>
<br>
> What surprises me is that why the db server refuses to work. I am positive<br>
> that they are completely different set and then it should be in different<br>
> rows modifications.<br>
><br>
> And then storm does not throw exception on this case so I can catch using<br>
> except and try again or do something about it.<br>
><br>
> The problem is fixed if: I call store.commit() after each object value<br>
> update (store.flush() is not enough) ; but it is painfully slow<br>
><br>
><br>
><br>
> MyISAM does not have that problem as well<br>
<br>
</div>Well MyISAM doesn't support transactions, so you shouldn't expect it<br>
to report transaction serialisation errors ...<br>
<font color="#888888"><br>
James.<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Steve Kieu<div>Ph: +61-7-3367-3241 <br></div><div>sip:*<a href="mailto:01161428@sipbroker.com" target="_blank">01161428@sipbroker.com</a></div><br>