]> review.fuel-infra Code Review - openstack-build/heat-build.git/commit
Get db session from the context.
authorSteve Baker <sbaker@redhat.com>
Wed, 21 Nov 2012 19:15:05 +0000 (08:15 +1300)
committerSteve Baker <sbaker@redhat.com>
Wed, 21 Nov 2012 19:15:05 +0000 (08:15 +1300)
commit67f4f608153048ec3cb566d63d4df7b1d7fe05e4
tree01ed0008e9cb93699386628d844ff5f102d3b4e3
parentb1787bd43e6c7a56523d0bc246008815fb508454
Get db session from the context.

The aim is to use a single sqlalchemy session for an RPC request.

The context object passed to EngineAPI methods is actually an RpcContext
which contains the same data as the RequestContext. The @request_context
decorator turns this back into a RequestContext which can now have other
behaviours added to it.

RequestContext now has a lazy loaded session attribute.

Save calls on created entities need to be passed the shared session.

Change-Id: Ied4e66deaca205362b84fb698f75cc872886607d
heat/common/context.py
heat/db/api.py
heat/db/sqlalchemy/api.py
heat/engine/parser.py
heat/engine/resources/resource.py
heat/engine/service.py