
Usage reader and writer for db operations. In Neutron code we have common situation like: with context.session.begin(): context.session.add(obj) self._make_obj_dict(obj) With new enginefacade we change context.session.begin() for db.context_manager.writer(reader).using(context). When object leaves this with-block, its reference to session is cleared because session is discarded. To use this object later to load some data from its dependencies, we have to provide different session to work in. To solve this obj either can be moved under with-block or we have to do context.session.add(obj) one more time to be able to load relations. This change also switches to usage of new enginefacade for some db operations with ports, in order to pass unit and functional tests. Partially-Implements blueprint: enginefacade-switch Change-Id: Ia15c63f94d2c67791da3b65546e59f6929c8c685
Team and repository tags
Welcome!
To learn more about neutron:
- Documentation: http://docs.openstack.org
- Features: http://specs.openstack.org/openstack/neutron-specs
- Defects: http://launchpad.net/neutron
Get in touch via email. Use [Neutron] in your subject.
To learn how to contribute:
CONTRIBUTING.rst
Description
Languages
Python
99.7%
Shell
0.3%