Re: Spyce and SQL Alchemy Questions
Bruce Webber <[email protected]>
| Newsgroups | gmane.comp.python.spyce.general |
|---|---|
| Message-ID | <A1E6DDFAE7CA7948025F78FA@[10.9.30.130]> |
--Jonathan Ellis <[email protected]> wrote: > Spyce isn't doing anything special to keep it around; that's just the > default SQLAlchemy behavior. SA stores the engine in a (module-level) > global somewhere... it "just works" because the setup you are using > only involves the one Python process. > > If you had a non-Spyce program like this, > > // foo.py > from sqlalchemy import * > > def one(): > // init db > > def two(): > session = create_session() > > one() > two() > > ... you would see the same behavior, even though no global state per se > is shared between one() and two(). Thanks! That clears up my confusion. -- Bruce Webber [email protected] http://brucewebber.us