Re: Spyce and SQL Alchemy Questions

"Jonathan Ellis" <[email protected]>
Newsgroups gmane.comp.python.spyce.general
Message-ID <[email protected]>
On Tue, 06 Jun 2006 14:29:38 -0400, "Bruce Webber"
<[email protected]> said:
> > If you want a global session (and, as you noticed, you probably don't
> > :), rather than a pool + flags approach, it's more straightforward to
> > put your initialization code in your configuration .py file, which you
> > can then use as "from spyceConfig import ..."  (No matter what your
> > config file is actually named, spyce references it as spyceConfig.)
> 
> So if I understand correctly, my approach of using pool + flags is fine
> as 
> long as I make sure each user has his own SQL Alchemy session object. Is 
> that right?

Yes.  (Although it won't work if you switch to mod_python, since pool
requires its values to be pickle-able.)  And you probably need to
manually ensure thread-safety by locking appropriately; with the module
approach, the Python import lock takes care of that for you.

> As always, thanks for your prompt and informative replies.

No problem.

-Jonathan
-- 
C++ is history repeated as tragedy. Java is history repeated as farce.  --Scott McKay
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.