Merge "Add effective note on DB exception to be aware of"

This commit is contained in:
Jenkins 2015-10-22 10:42:45 +00:00 committed by Gerrit Code Review
commit 8ec2752e09
1 changed files with 6 additions and 0 deletions

View File

@ -98,6 +98,12 @@ Document common pitfalls as well as good practices done during database developm
q = query(Object.id, Object.name,
func.count(Object.number)).group_by(Object.id, Object.name)
* Beware of the `InvalidRequestError <http://docs.sqlalchemy.org/en/rel_0_8/faq.html#this-session-s-transaction-has-been-rolled-back-due-to-a-previous-exception-during-flush-or-similar>`_ exception.
There is even a `Neutron bug <https://bugs.launchpad.net/neutron/+bug/1409774>`_
registered for it. Bear in mind that this error may also occur when nesting
transaction blocks, and the innermost block raises an error without proper
rollback. Consider if `savepoints <http://docs.sqlalchemy.org/en/rel_1_0/orm/session_transaction.html#using-savepoint>`_
can fit your use case.
System development
~~~~~~~~~~~~~~~~~~