On Oct 15, 2008, at 5:55 PM, Diarmuid wrote:

>
> Hi,
>
> I have developed an app that uses sqlite as the database. The app
> creates the database, creates the orm tables, and creates a Session
> object using sessionmaker. The database is set as a global variable as
> is the meta data and session object. It all works fine at that point.
> I then create a series of threads that have access to the global
> variables. This is where there is a problem. If the database is a file
> system database, all works fine. However, if I use an in memory
> database, I get an error in base.py method _cursor_execute
>
> This is the error followed by the sql.
>
> OperationalError: (OperationalError) no such table:
>
> So in summary, my situation is that an in memory sqlite database is
> not accessible from multiple threads. I am using 0.4.0
>

here's some extra detail:

http://lists.initd.org/pipermail/pysqlite/2005-December/000279.html

If you do in fact experiment with the check_same_thread flag described  
in that link, you should also use the StaticPool implementation so  
that exactly one connection is held for the engine:

from sqlalchemy.pool import StaticPool
create_engine('sqlite://', poolclass=StaticPool)





--~--~---------~--~----~------------~-------~--~----~
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