Ticket #1393 (new enhancement)

Opened 2 years ago

Last modified 3 months ago

Avoid module-globals in database.py

Reported by: alberto Assigned to: anonymous
Priority: normal Milestone: 1.5
Component: TurboGears Version: 1.0.4b3
Severity: normal Keywords: database, sprint
Cc:

Description

database.py uses some module globals which assume there's only one TG app living in the process. TG 1.1 should allow mounting several apps, from different eggs, side by side in the same process so this pattern must be avoided.

A solution is to dump all these globals at the new turbogears.globals StackedObjectProxy? which is local to each app. Something like: turbogears.globals.hub, turbogears.globals.sa_engine, etc...

For backwards compatibility, a proxy to turbogears.globals.foo can be left at the old location. See view.engines at the trunk for an example.

This is can also be a good time to add support for multiple engines per app as long as the API remains compatible.

Alberto

Change History

12/19/07 04:50:26 changed by Chris Arndt

  • version changed from trunk to 1.0.4b3.

06/06/08 07:30:15 changed by faide

  • type changed from defect to enhancement.
  • milestone changed from 1.1 to 1.1.1.

08/24/08 10:27:19 changed by faide

  • milestone changed from 1.6 to 1.5.