Re: SOLUTION

2010-03-19 Thread królewna
I have found the solution. I dont know why in python documentation there is not a single word about this option. I've found it in pysqlite doc site. So we have to add a new keyword argument to connection function and we will be able to create cursors out of it in different thread. So use: sqli

Re: sqlite3, memory db and multithreading

2010-03-19 Thread królewna
W dniu 19.03.2010 12:10, Tim Golden pisze: Is it possible you've misunderstood the meaning of the word "serialize" here? It's not possible, it just happened :) What's being suggested isn't serialising (ie marshalling, pickling) the data; rather, serialising the *access*, ie pushing all db requ

Re: sqlite3, memory db and multithreading

2010-03-19 Thread królewna
W dniu 19.03.2010 08:20, Expo pisze: You can put the SQLite database into a Singleton class and use a semaphore to serialize the access to methods which writes to the database. I've tried this out but doesnt work. Still gives an error like: ProgrammingError: SQLite objects created in a thread

Re: sqlite3, memory db and multithreading

2010-03-19 Thread królewna
W dniu 18.03.2010 23:06, Aahz pisze: You probably need to serialize access to the database through one thread. sqlite3 objects are not pickable so it's not proper way. -- best regards princess -- http://mail.python.org/mailman/listinfo/python-list

Re: sqlite3, memory db and multithreading

2010-03-19 Thread królewna
W dniu 18.03.2010 15:49, DreiJane pisze: Principally sqlite connections (sqlite3 objects in the C-API) can be used over multiple threads - and connections to :memory: make no difference. There are additional parameters to open() giving fine- tuned control. And apsw is promising a true reflection

sqlite3, memory db and multithreading

2010-03-18 Thread królewna
The problem is simple: I have multiple threads within one program. At least 2 threads have to have access to in-memory sqlite database. It is not possible to pass sqlite objects to those threads because an exception is rised: ProgrammingError: SQLite objects created in a thread can only be use