Comment 2 for bug 1224429

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

Reviewed: https://review.openstack.org/46258
Committed: http://github.com/stackforge/savanna/commit/9390ce7b035a7d60d0c665dc0891b67f7436e8f3
Submitter: Jenkins
Branch: master

commit 9390ce7b035a7d60d0c665dc0891b67f7436e8f3
Author: Chang Bo Guo <email address hidden>
Date: Thu Sep 12 04:45:31 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: I2204b3023c01e65950e6131cd08b4ded5564e9b9