Re: [sqlite] threads and transactions

2011-02-05 Thread Igor Tandetnik
David M. Cotter wrote: > i may not have been clear > > i want to begin transactions on different threads at once Why, if you don't mind me asking? Your hard drive has only one write head. What makes you feel that writing to the same file from multiple threads would be any

Re: [sqlite] threads and transactions

2011-02-05 Thread Igor Tandetnik
David M. Cotter wrote: >> In SQLite every write is in a transaction whether you declare one with BEGIN >> or not. If you don't declare a transaction, SQLite >> invisibly surrounds each individual INSERT or UPDATE with a BEGIN and >> COMMIT. > sure, that's fine. but if

Re: [sqlite] threads and transactions

2011-02-05 Thread Simon Slavin
On 6 Feb 2011, at 1:30am, David M. Cotter wrote: >> In SQLite every write is in a transaction whether you declare one with BEGIN >> or not. If you don't declare a transaction, SQLite invisibly surrounds each >> individual INSERT or UPDATE with a BEGIN and COMMIT. > sure, that's fine. but if

Re: [sqlite] threads and transactions

2011-02-05 Thread David M. Cotter
forgive my not understanding this but i'm trying to be extremely clear and i am not sure from your answer whether you have understood my question. > In SQLite every write is in a transaction whether you declare one with BEGIN > or not. If you don't declare a transaction, SQLite invisibly

Re: [sqlite] threads and transactions

2011-02-05 Thread Simon Slavin
On 5 Feb 2011, at 11:00pm, David M. Cotter wrote: > i may not have been clear > > i want to begin transactions on different threads at once > in each thread > begin a transaction > insert lots of data, this may take a long time > commit transaction Okay, here's some

Re: [sqlite] threads and transactions

2011-02-05 Thread David M. Cotter
i may not have been clear i want to begin transactions on different threads at once in each thread begin a transaction insert lots of data, this may take a long time commit transaction i understand that one commit will block the other but does inserting data during a

Re: [sqlite] threads and transactions

2011-02-05 Thread Pavel Ivanov
> i understand that one "commit" will block all other threads from doing a > "commit", "rollback" or any atomic transaction, until it's done, but are you > saying i can't even add data on another thread while one has an open > transaction? There can be several simultaneous read-only

Re: [sqlite] threads and transactions

2011-02-05 Thread David M. Cotter
> Transactions are per-connection and have nothing to do > with threads. If you want different transactions in each thread you > need to make one connection for each thread. But those transactions > won't be able to execute simultaneously. so if i open a separate connection on each thread then

Re: [sqlite] threads and transactions

2011-02-05 Thread Pavel Ivanov
> presuming this timeline is chronological, may i assume that step 4 is > committed first in the database? You mean as a third transaction? No. > and that steps 5 and 6 operate independently? No. > even when threads 1 and 2 open their individual transactions, i see only ONE > journal file >

[sqlite] threads and transactions

2011-02-05 Thread David M. Cotter
i'm sure this topic has been beaten to death but i just really want to make sure. i'm using ONE database, and one handle to it on all threads here's a theoretical timeline -- 1) thread 1 begin transaction do bunches of stuff 2) thread 2 begin transaction do bunches of stuff

Re: [sqlite] Is this SQLite implementation doing something stupid?

2011-02-05 Thread Eric Smith
Ian Hardingham wrote: > I'm using an SQLite implementation that someone else made for my > high-level language of choice. > > While looking through the imp, I've just found this function, which is > used as the callback argument to sqlite3_exec. Does this look like an > ok useage? It seems

Re: [sqlite] Sub-Select reports only row one value?

2011-02-05 Thread Igor Tandetnik
Jeff Hennick wrote: > I am having problems with Sub-Select apparently working on one row > rather than the whole table. When syntactically used as an expression (e.g. in SELECT clause), a subselect produces a single value. When used as a table (e.g. in FROM clause), it may

Re: [sqlite] Is this SQLite implementation doing something stupid?

2011-02-05 Thread Igor Tandetnik
Ian Hardingham wrote: > I'm using an SQLite implementation that someone else made for my > high-level language of choice. > > While looking through the imp, I've just found this function, which is > used as the callback argument to sqlite3_exec. Does this look like an > ok

[sqlite] Sub-Select reports only row one value?

2011-02-05 Thread Jeff Hennick
I am having problems with Sub-Select apparently working on one row rather than the whole table. registrations table: Class | Term | (Other student columns) CC123 | 101 | ... CC002 | 101 CC050 | 111 CC123 | 101 CC123 | 102 ... Desired ultimate output counts by class and term, with totals and

Re: [sqlite] Sqlite management

2011-02-05 Thread mustafa
2011/2/5 John Drescher > On Sat, Feb 5, 2011 at 6:36 AM, mustafa wrote: > > Hello, > > > > I am planning to write an open source software with wxWidgets > > to simplify SQLite operations(select,insert etc) > > > > There are open source alternative

Re: [sqlite] Sqlite management

2011-02-05 Thread John Drescher
On Sat, Feb 5, 2011 at 6:36 AM, mustafa wrote: > Hello, > > I am planning to write an open source software with wxWidgets > to simplify SQLite operations(select,insert etc) > > There are open source alternative softwares. > http://sourceforge.net/projects/sqlitemanager/ > > >

[sqlite] Sqlite management

2011-02-05 Thread mustafa
Hello, I am planning to write an open source software with wxWidgets to simplify SQLite operations(select,insert etc) There are open source alternative softwares. http://sourceforge.net/projects/sqlitemanager/ http://sqlitebrowser.sourceforge.net/index.html

[sqlite] Is this SQLite implementation doing something stupid?

2011-02-05 Thread Ian Hardingham
Hey guys. I'm using an SQLite implementation that someone else made for my high-level language of choice. While looking through the imp, I've just found this function, which is used as the callback argument to sqlite3_exec. Does this look like an ok useage? It seems to me like this might be