Comment 3 for bug 1224429

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/46253
Committed: http://github.com/openstack/nova/commit/037d1e9b1b89fb0a969b1b02ee4c74550b7864b0
Submitter: Jenkins
Branch: master

commit 037d1e9b1b89fb0a969b1b02ee4c74550b7864b0
Author: Chang Bo Guo <email address hidden>
Date: Thu Sep 12 04:27:40 2013 -0700

    Don't use ModelBase.save() inside of transaction

    We using block 'with session.begin()' to organize some operations in
    one transaction. session.begin() returns a transaction instance, then
    does some operations, and will commit or rollback automatically
    before leaving the block. ModelBase.save() always submit a commit,
    and that is not expected.
    When we get a persistent object from database, we just modify the
    object inside of block 'with session.begin()' and sqlalchemy will
    update it,don't need method session.add() or ModelBase.save()

    Fixes bug #1224429

    Change-Id: I8af3fd4b62a915833bf303b6892d432043fb57a9