Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1393 (closed enhancement: wontfix)

Opened 12 years ago

Last modified 9 years ago

Avoid module-globals in database.py

Reported by: alberto Owned by: anonymous
Priority: normal Milestone: 2.1rc1
Component: TurboGears Version: trunk
Severity: normal Keywords: database
Cc:

Description (last modified by mramm) (diff)

database.py uses some module globals which assume there's only one TG app living in the process. TG 2.0 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, tg.globals.sa_engine, etc...

Alberto

Change History

comment:1 Changed 12 years ago by Chris Arndt

  • Version changed from trunk to 1.0.4b3

comment:2 Changed 11 years ago by faide

  • Type changed from defect to enhancement
  • Milestone changed from 1.1 to 1.1.1

comment:3 Changed 11 years ago by faide

  • Milestone changed from 1.6 to 1.5

comment:4 Changed 11 years ago by mramm

  • Keywords database added; database, sprint removed
  • Version changed from 1.0.4b3 to trunk
  • Description modified (diff)
  • Milestone changed from 1.5 to 2.0

comment:5 Changed 11 years ago by jorge.vargas

this should solve #2081

comment:6 Changed 11 years ago by mramm

  • Milestone changed from 2.0 to 2.0b4

comment:7 Changed 10 years ago by mramm

Hmm, I agree this would be nice. But for normal TG applications it's extra complexity that people don't use. On the other hand for apps that people will want to mount inside other apps, but which have their own models, it would be very helpful.

So, I see a couple options thoughts:

1) a separate paster template for mountable apps 2) a recipie in the docs for how to do this 3) just do it and handle the extra complexity

comment:8 Changed 10 years ago by mramm

  • Milestone changed from 2.0b5 to 2.1

comment:9 Changed 10 years ago by percious

I'm -1 on this. The more we rely on SOP, the slower TG will get. Let's keep it how it is.

comment:10 Changed 9 years ago by mramm

  • Status changed from new to closed
  • Resolution set to wontfix

comment:11 Changed 9 years ago by percious

  • Milestone changed from 2.1 to 2.1rc1
Note: See TracTickets for help on using tickets.