On Nov 8, 2012, at 5:01 PM, Torsten Landschoff wrote:

> 
> My first tests with the SQLAlchemy core where promising, but when using
> the ORM I get a bunch of deadlocks where it seems like the session opens
> two connections A and B where A locks B out.

The Session never does this, assuming just one Engine associated with it.  It 
acquires one Connection from the Engine, holds onto it and uses just that 
connection, until commit() at which point the connection is released to the 
pool.   

SQLite supports a "SERIALIZABLE" mode of isolation, in conjunction with a 
workaround for a pysqlite bug 
(http://docs.sqlalchemy.org/en/rel_0_7/dialects/sqlite.html#serializable-transaction-isolation)
 which might be what you're looking for, though I generally try to steer users 
away from any usage of SQLite that depends on high concurrency (see "High 
Concurrency" at http://sqlite.org/whentouse.html).

To diagnose this code, you'd need to make use of the tools available - which 
includes connection pool logging, engine logging, and possibly usage of custom 
pools like sqlalchemy.pool.AssertionPool which ensures that only one connection 
is used at any time.


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

Reply via email to