On 19/10/11 09:59, M.-A. Lemburg wrote: [snip] >> risks to become a problem, with the close() that may raise an error >> > because the connection has been implicitly closed by a communication >> > error. Note that close() in itself often is a quite safe operation, >> > not involving database communication, so it is not expected to fail >> > and may not be well guarded. > That last sentence is not quite correct: .close() issues an implicit > .rollback() and usually also tells the database backend to free up > resources maintained for the connection, so it does require communication > with the backend.
Here is the problem. Does .close() always issue an implicit .rollback()? The DBAPI says yes but, as noted previously, the driver can choose to NOT send a rollback. In fact on the second .close() the driver SHOULD NOT send a rollback because there is no transaction in progress. I'd vote for idempotent .close() interpretation too. federico -- Federico Di Gregorio f...@initd.org Una nazionale senza neanche una nazione. -- macchinavapore
signature.asc
Description: OpenPGP digital signature
_______________________________________________ DB-SIG maillist - DB-SIG@python.org http://mail.python.org/mailman/listinfo/db-sig