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 Tim Golden
On 19/03/2010 10:56, królewna wrote: 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. Is it possible you've misunderstood the meaning of the word "serialize" here? What's b

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

Re: sqlite3, memory db and multithreading

2010-03-19 Thread Expo
On Mar 18, 1:58 pm, królewna wrote: > 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

Re: sqlite3, memory db and multithreading

2010-03-18 Thread John Nagle
królewna wrote: 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 threa

Re: sqlite3, memory db and multithreading

2010-03-18 Thread Aahz
In article , =?UTF-8?B?a3LDs2xld25h?= wrote: > >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: > >ProgrammingErr

Re: sqlite3, memory db and multithreading

2010-03-18 Thread DreiJane
Hello, i cannot help you directly with sqlite2 in the Standardlib, since i am used to work with Roger Binns's apsw. After a short experiment with pysqlite leading to data loss - caused by one of the unclearer exception messages of sqlite3 and me having a bad day - i at once turned back to apsw. An

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