On Aug 28, 2012, at 2:06 PM, Owen Nelson wrote:

> mmm yeah I can't really say from this end.   You'd need to get in there and 
> see exactly at which point sessions are being set up and torn down.   But I'm 
> pretty sure you don't have any extra threads going on unless you have 
> something in your app that specifically spawns a thread.     
> 
> It might not be webtest that's starting new threads, but rather the app 
> engine nose plugin, or the various testbeds that come with (task queue 
> emulation, search service, datastore, etc). For checking the setup/teardown 
> of the sessions, what's the recommended tactic? I'm thinking: hook up some 
> logging to some session events.

is there any chance you can get your test suite to run in a regular environment 
first ?    app engine supposedly has extra weird behaviors like MySQL 
connections that go away randomly and stuff like that.

right now the Session events will give you hooks into transaction lifecycle, 
but not as much the session itself being closed totally.   you might try just 
using a custom Session subclass with your scoped_session() that does what you 
need.

>  
> 
> > 
> > The issue I was seeing with sqlite :memory: was that after closing sessions 
> > the schema would go away. Seems like to get this to work, I'd have to make 
> > sure a session was kept alive throughout the run of the test (which is what 
> > I want anyway). 
> 
> well this is also strange, because an engine that uses sqlite with a :memory: 
> connection will keep the connection persistent, using the 
> SingletonThreadPool.  Closing the session won't affect this connection being 
> open assuming default usages.   If your create_engine() is specifying a 
> specific pool like NullPool, then yes :memory: won't work with that. 
> 
>  
> We specified a StaticPool -- I'll omit and see if that yields a better 
> result. 

StaticPool should never be closing the DBAPI connection, so again this is 
strange.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to