Re:I only know PHP. How do I write a Web application in Python?
by jeltz on Sunday May 06, 2012 @05:36PM
(#3936405)
Why not the third (and in my experience most common) alternative? Autocommit but if you explicitly start a transaction then automcommit is turned off until that transaction has been committed.
[ Parent
| on HN ]
Re:I only know PHP. How do I write a Web application in Python?
by zzzeek on Sunday May 06, 2012 @07:01PM
(#3936707)
If you have more than one statement, then autocommit is usually wrong, and what you usually want is transaction-per-request. If you have exactly one statement, then autocommit is exactly identical to transaction-per-request.
Also part of the transaction-per-request pattern is that the transaction is started when the first statement is invoked. So there's no overhead for zero-statement requests either.