Re: [sqlite] Transactions for read operations

2014-09-07 Thread Richard Warburton
Thanks to those who responded to my query. Simon: It will be easier to code if every page commits, regardless of whether any write operations occurred (and rollback only error) - so your answer pleased me greatly. Keith: Yes, you're right. I'm not passing a single database connection around,

[sqlite] Transactions for read operations

2014-09-06 Thread Richard Warburton
Hi, Brief: Should transactions be used for ensuring consistency between multiple queries? And if so, after I've finished is there a reason why I should not call commit? Background: I'm using SQLite for a web service. The database reference is passed to Page objects, which handle their specific

Re: [sqlite] Transactions for read operations

2014-09-06 Thread Simon Slavin
On 7 Sep 2014, at 3:22am, Richard Warburton rich...@skagerraksoftware.com wrote: Should transactions be used for ensuring consistency between multiple queries? Good idea. And if so, after I've finished is there a reason why I should not call commit? You should finish the transaction some

Re: [sqlite] Transactions for read operations

2014-09-06 Thread Keith Medcalf
On Saturday, 6 September, 2014, at 20:23, Richard Warburton rich...@skagerraksoftware.com inquired: Brief: Should transactions be used for ensuring consistency between multiple queries? And if so, after I've finished is there a reason why I should not call commit? Background: I'm using

Re: [sqlite] Transactions for read operations

2014-09-06 Thread Darren Duncan
As a general principle, database transactions should be held for as short a time as possible. You should start your transaction, then do all of the operations immediately that need to be mutually consistent, and then end the transaction appropriately; ideally a transaction is only open for a

Re: [sqlite] Transactions for read operations

2014-09-06 Thread Simon Slavin
On 7 Sep 2014, at 3:49am, Keith Medcalf kmedc...@dessus.com wrote: You say the database connection. Did you use the language imprecisely or are you using only one database connection? One presumes that you may have half-a-million pages and half-a-billion concurrent HTTP operations, in

Re: [sqlite] Transactions for read operations

2014-09-06 Thread Keith Medcalf
of SQLite Database Subject: Re: [sqlite] Transactions for read operations On 7 Sep 2014, at 3:49am, Keith Medcalf kmedc...@dessus.com wrote: You say the database connection. Did you use the language imprecisely or are you using only one database connection? One presumes that you may have half

[sqlite] transactions do not respect delete

2014-05-06 Thread Jim Carroll
I need to modify all the content in a table. So I wrap the modifications inside a transaction to ensure either all the operations succeed, or none do. I start the modifications with a DELETE statement, followed by INSERTs. What I've discovered is even if an INSERT fails, the DELETE has still

Re: [sqlite] transactions do not respect delete

2014-05-06 Thread Dominique Devienne
On Tue, May 6, 2014 at 2:31 PM, Jim Carroll j...@carroll.com wrote: CREATE TABLE A(id INT PRIMARY KEY, val TEXT); INSERT INTO A VALUES(1, hello); BEGIN; DELETE FROM A; INSERT INTO A VALUES(1, goodbye); INSERT INTO A VALUES(1, world); COMMIT; Sounds like you want ON CONFLICT

Re: [sqlite] transactions do not respect delete

2014-05-06 Thread Mark Lawrence
It would appear the DELETE was successful, and the first INSERT was successful. But when the second INSERT failed (as it was intended to)..it did not ROLLBACK the database. Even though the second INSERT fails, your script still calls COMMIT on an open transaction in which the DELETE and first

Re: [sqlite] transactions do not respect delete

2014-05-06 Thread Clemens Ladisch
Jim Carroll wrote: BEGIN; DELETE FROM A; INSERT INTO A VALUES(1, goodbye); INSERT INTO A VALUES(1, world);-- fails COMMIT; It would appear the DELETE was successful, and the first INSERT was successful. But when the second INSERT failed (as it was intended to)..it did

Re: [sqlite] transactions do not respect delete

2014-05-06 Thread Dominique Devienne
On Tue, May 6, 2014 at 2:59 PM, Clemens Ladisch clem...@ladisch.de wrote: With the COMMIT, you told the database that the transaction succeeded (which means that the effects of all successful statements are saved permanently.) If you want the transaction to fail, execute ROLLBACK instead.

Re: [sqlite] transactions do not respect delete

2014-05-06 Thread Jim Carroll
Date: Tue, 6 May 2014 14:57:30 +0200 From: Mark Lawrence no...@null.net To: sqlite-users@sqlite.org Subject: Re: [sqlite] transactions do not respect delete Message-ID: 20140506125730.ga23...@rekudos.net Content-Type: text/plain; charset=us-ascii It would appear the DELETE was successful

[sqlite] Transactions

2014-02-28 Thread L. Wood
Is this legal? 1) Create INSERT prepared statement with parameters. 2) Create a second non-parameter BEGIN TRANSACTION prepared statement, execute it with _step(), and finalize it. 3) Attach values to the parameters of the first INSERT prepared statement, _step() it, _reset() it. Repeat 3)

Re: [sqlite] Transactions

2014-02-28 Thread Igor Tandetnik
On 2/28/2014 5:48 PM, L. Wood wrote: Is this legal? 1) Create INSERT prepared statement with parameters. 2) Create a second non-parameter BEGIN TRANSACTION prepared statement, execute it with _step(), and finalize it. 3) Attach values to the parameters of the first INSERT prepared statement,

[sqlite] transactions and locking

2012-05-02 Thread Lars Hansen
Hello, I'm sorry I have to bother you readers but I haven't understood http://sqlite.org/lockingv3.html chapter 7. 1. In autocommit mode, all changes to the database are committed as soon as all operations associated with the current database connection complete. How does SQLite know when ALL

Re: [sqlite] transactions and locking

2012-05-02 Thread Jay A. Kreibich
On Wed, May 02, 2012 at 01:16:41PM +0200, Lars Hansen scratched on the wall: Hello, I'm sorry I have to bother you readers but I haven't understood http://sqlite.org/lockingv3.html chapter 7. 1. In autocommit mode, all changes to the database are committed as soon as all operations

Re: [sqlite] transactions and locking

2012-05-02 Thread Simon Slavin
On 2 May 2012, at 12:16pm, Lars Hansen la...@me.com wrote: I'm sorry I have to bother you readers but I haven't understood http://sqlite.org/lockingv3.html chapter 7. I've answered your questions in order, but they're all interrelated, so please read them all before worrying about the first

Re: [sqlite] transactions and locking

2012-05-02 Thread Lars Hansen
Thank you both, I now have a better understanding. Lars ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Transactions for SELECT

2011-11-22 Thread Baruch Burstein
Do transactions speed up SELECT statements? -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook

Re: [sqlite] Transactions for SELECT

2011-11-22 Thread Dan Kennedy
On 11/22/2011 04:34 PM, Baruch Burstein wrote: Do transactions speed up SELECT statements? They can a bit. If you put 10 SELECT statements in a transaction SQLite only has to lock and unlock the database file once. If you run them outside of a transaction the db is locked and unlocked 10

Re: [sqlite] Transactions for SELECT

2011-11-22 Thread Baruch Burstein
I will when I get the chance, but I am trying to get a list of things to try to improve my SELECT speeds. If it is one SELECT, but returning +-1 rows, it probably won't make a difference, right? On Tue, Nov 22, 2011 at 11:41 AM, Dan Kennedy danielk1...@gmail.com wrote: On 11/22/2011 04:34

Re: [sqlite] Transactions for SELECT

2011-11-22 Thread Simon Slavin
On 22 Nov 2011, at 10:45am, Baruch Burstein wrote: I will when I get the chance, but I am trying to get a list of things to try to improve my SELECT speeds. If it is one SELECT, but returning +-1 rows, it probably won't make a difference, right? Right. It'll do a lock, then the SELECT,

Re: [sqlite] Transactions for SELECT

2011-11-22 Thread Dan Kennedy
On 11/22/2011 05:45 PM, Baruch Burstein wrote: I will when I get the chance, but I am trying to get a list of things to try to improve my SELECT speeds. If it is one SELECT, but returning +-1 rows, it probably won't make a difference, right? No advantage in wrapping a single statement, of

Re: [sqlite] TRANSACTIONs

2011-06-02 Thread Jan Hudec
On Wed, Jun 01, 2011 at 19:23:16 +0100, Simon Slavin wrote: On 1 Jun 2011, at 7:12pm, Jan Hudec wrote: Do not update a table if there is some select statement currently Actually insert, update and delete are OK. Drop and alter table are a problem. Pavel is right. He left out some

Re: [sqlite] TRANSACTIONs

2011-06-02 Thread Simon Slavin
On 2 Jun 2011, at 6:01pm, Jan Hudec wrote: - Inside one transaction, running select may or may not see data inserted or updated in parallel. Sorry to go on about this but you underestimate the problem. Suppose you're part-way through _step()ing through the results of a SELECT and an

[sqlite] TRANSACTIONs

2011-06-01 Thread Ian Hardingham
Hey guys, thanks for all the help so far today. From within a BEGIN TRANSACTION and END TRANSACTION block, should I not update the same row in a table more than once? What are the exact limitations on what I can do during a Transaction? Thanks, Ian

Re: [sqlite] TRANSACTIONs

2011-06-01 Thread Pavel Ivanov
 From within a BEGIN TRANSACTION and END TRANSACTION block, should I not update the same row in a table more than once? You can update it as many times as you need.  What are the exact limitations on what I can do during a Transaction? Do not update a table if there is some select statement

Re: [sqlite] TRANSACTIONs

2011-06-01 Thread Jan Hudec
On Wed, Jun 01, 2011 at 10:17:02 -0400, Pavel Ivanov wrote:  From within a BEGIN TRANSACTION and END TRANSACTION block, should I not update the same row in a table more than once? You can update it as many times as you need.  What are the exact limitations on what I can do during a

Re: [sqlite] TRANSACTIONs

2011-06-01 Thread Simon Slavin
On 1 Jun 2011, at 7:12pm, Jan Hudec wrote: On Wed, Jun 01, 2011 at 10:17:02 -0400, Pavel Ivanov wrote: From within a BEGIN TRANSACTION and END TRANSACTION block, should I not update the same row in a table more than once? You can update it as many times as you need. What are the exact

Re: [sqlite] TRANSACTIONs

2011-06-01 Thread Robert Myers
On 6/1/2011 1:23 PM, Simon Slavin wrote: On 1 Jun 2011, at 7:12pm, Jan Hudec wrote: On Wed, Jun 01, 2011 at 10:17:02 -0400, Pavel Ivanov wrote: From within a BEGIN TRANSACTION and END TRANSACTION block, should I not update the same row in a table more than once? You can update it as many

Re: [sqlite] TRANSACTIONs

2011-06-01 Thread Pavel Ivanov
Actually, you do know what SQLite does without knowing the internals. It claims to be serializable and ACID (http://www.sqlite.org/transactional.html), therefore it's fine. Serializable there means that once transaction is started statements won't see any data committed in other transactions.

Re: [sqlite] TRANSACTIONs

2011-06-01 Thread Robert Myers
On 6/1/2011 1:47 PM, Pavel Ivanov wrote: Actually, you do know what SQLite does without knowing the internals. It claims to be serializable and ACID (http://www.sqlite.org/transactional.html), therefore it's fine. Serializable there means that once transaction is started statements won't see

Re: [sqlite] TRANSACTIONs

2011-06-01 Thread Pavel Ivanov
What about the I of ACID? The select should have an implicit transaction around it. No, it shouldn't. It can be a part of some other transaction. I in ACID means Isolation of transactions, not Isolation of select statements. Otherwise there would be no way for select statement to read

Re: [sqlite] TRANSACTIONs

2011-06-01 Thread Simon Slavin
On 1 Jun 2011, at 7:57pm, Robert Myers wrote: What about the I of ACID? The select should have an implicit transaction around it. That would violate the SQL standard which says you can SELECT data which you haven't committed yet. Actually the bit of ACID you want for SELECT is really the

[sqlite] Transactions while using prepare and step

2010-12-02 Thread cricketfan
Hello I have a basic question and would be glad if someone can answer it. I understand that if we have BEGIN TRANSACTION and END TRANSACTION then the transaction(s) within that block would be committed, number of transactions could be 10,100,1000 or 1. . Otherwise, SQLITE by default

Re: [sqlite] Transactions while using prepare and step

2010-12-02 Thread Simon Slavin
On 2 Dec 2010, at 3:44pm, cricketfan wrote: Hello I have a basic question and would be glad if someone can answer it. I understand that if we have BEGIN TRANSACTION and END TRANSACTION then the transaction(s) within that block would be committed, number of transactions could be 10,100,1000

Re: [sqlite] Transactions while using prepare and step

2010-12-02 Thread Pavel Ivanov
Makes no difference.  Doing an UPDATE inside your SELECT violates the rule no matter how you structure your transaction.  A SELECT is a single operation and you can't do anything else until it is finished. I didn't see in OP's email any information on whether he updates the same rows or same

Re: [sqlite] Transactions while using prepare and step

2010-12-02 Thread Simon Slavin
On 2 Dec 2010, at 4:39pm, Pavel Ivanov wrote: I didn't see in OP's email any information on whether he updates the same rows or same table as he selects, so I'd say this statement is too harsh in general case. While select is executing you shouldn't update the same rows that were returned,

Re: [sqlite] Transactions while using prepare and step

2010-12-02 Thread Pavel Ivanov
Another question - What kind of impact does a limit clause have? The columns being used in the where clause are indexed. My current design is bad, I am forced to use limit to get one row at a time. Since I have an index the impact should be minimal. Please let me know if I am wrong. You

Re: [sqlite] Transactions while using prepare and step

2010-12-02 Thread Simon Slavin
On 2 Dec 2010, at 7:38pm, cricketfan wrote: { Select a from tbl1 where b='yyy' c ='xxx' limit i offset (i + 1) ; Update tbl1 set e=1 where a = some value from the select; i = i + 1 } There doesn't appear to be any purpose to anything but the UPDATE command. Can you not do all

[sqlite] SQLITE transactions failing with multiple threads

2010-11-30 Thread cricketfan
. -- View this message in context: http://old.nabble.com/SQLITE-transactions-failing-with-multiple-threads-tp30340806p30340806.html Sent from the SQLite mailing list archive at Nabble.com. ___ sqlite-users mailing list sqlite-users@sqlite.org http

Re: [sqlite] SQLITE transactions failing with multiple threads

2010-11-30 Thread Drake Wilson
Quoth cricketfan srtedul...@yahoo.co.in, on 2010-11-30 07:49:36 -0800: Also not that both threads are using the same handle passed by main. No, don't do that. Using the same handle in two threads concurrently can break depending on the SQLite threading mode, and will gain you no parallelism in

Re: [sqlite] SQLITE transactions failing with multiple threads

2010-11-30 Thread Simon Slavin
On 30 Nov 2010, at 3:49pm, cricketfan wrote: I have 2 threads in my program, 1st thread is doing inserts into a table and 2nd thread is trying to update the already inserted columns. 1. I have bundled the 1000 inserts per transaction in 1st thread. 2. When I try to start a

Re: [sqlite] SQLITE transactions failing with multiple threads

2010-11-30 Thread cricketfan
it works. Aside from that, transaction state is bound to a handle; you're starting a transaction and then trying to start another one inside it. Open two handles instead. -- View this message in context: http://old.nabble.com/SQLITE-transactions-failing-with-multiple-threads

Re: [sqlite] SQLITE transactions failing with multiple threads

2010-11-30 Thread Drake Wilson
Quoth cricketfan srtedul...@yahoo.co.in, on 2010-11-30 12:11:52 -0800: Drake, I am using SQLITE in threadsafe mode. Transaction inside another transaction isnt that equivalent of nested transactions? Should that be allowed? SQLite has named savepoints, but not nested BEGIN transactions. It's

Re: [sqlite] SQLITE transactions failing with multiple threads

2010-11-30 Thread cricketfan
-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users -- View this message in context: http://old.nabble.com/SQLITE-transactions-failing-with-multiple-threads-tp30340806p30343885.html Sent from the SQLite mailing list archive at Nabble.com

Re: [sqlite] SQLITE transactions failing with multiple threads

2010-11-30 Thread Simon Slavin
On 30 Nov 2010, at 8:11pm, cricketfan wrote: Drake, I am using SQLITE in threadsafe mode. Transaction inside another transaction isnt that equivalent of nested transactions? Should that be allowed? I have no problem opening another handle but just trying to understand the intricacies,

[sqlite] Transactions + .read

2010-03-31 Thread Kevin M.
Hopefully I'm not duplicating a question, but I looked on sqlite.org and did not find the answer... Will this: BEGIN TRANSACTION; .read somefile.sql END TRANSACTION; Put everything in the sql file into one transaction? Or do I need to put the BEGIN/END TRANSACTION statements in the sql file

Re: [sqlite] Transactions + .read

2010-03-31 Thread Simon Slavin
On 31 Mar 2010, at 4:21pm, Kevin M. wrote: Hopefully I'm not duplicating a question, but I looked on sqlite.org and did not find the answer... Will this: BEGIN TRANSACTION; .read somefile.sql END TRANSACTION; Put everything in the sql file into one transaction? Or do I need to put

Re: [sqlite] Transactions + .read

2010-03-31 Thread Kevin M.
Warning: From your phrasing it's possible you're thinking of putting a '.read' command into your program. The '.read' command is only a command to the command-line tool. It's not a function of SQLite, and you can't submit it as a query in your program. Simon. Actually I was wanting

Re: [sqlite] Transactions + .read

2010-03-31 Thread Simon Slavin
On 31 Mar 2010, at 4:48pm, Kevin M. wrote: Warning: From your phrasing it's possible you're thinking of putting a '.read' command into your program. The '.read' command is only a command to the command-line tool. It's not a function of SQLite, and you can't submit it as a query in your

Re: [sqlite] Transactions + .read

2010-03-31 Thread Kevin M.
Actually I was wanting to put that into a program. I don't know how I guessed that but I'm feeling really smug now. I'm feeling very amused by your smugness ;-) So, is there an API or query I can run to load an sql file all in one go (one transaction) without having to read in the file

Re: [sqlite] Transactions + .read

2010-03-31 Thread Simon Slavin
On 31 Mar 2010, at 6:39pm, Kevin M. wrote: So, is there an API or query I can run to load an sql file all in one go (one transaction) without having to read in the file manually and query one line at a time? No, sorry. That's what programming languages are for. Open the file, read a

[sqlite] transactions in one thread

2009-09-28 Thread Charles Samuels
I need to be able to see the committed version of a database while a new transaction is in the works. I would like to open the same database file twice in a single thread, start a transaction on one of the database connections, make a few writes to that database, then on the other database

Re: [sqlite] Transactions and attached databases

2009-02-26 Thread Tito Ciuro
Hi Donald, On Feb 25, 2009, at 3:39 PM, Griggs, Donald wrote: Greetings, Tito, Did you see page: http://www.sqlite.org/lang_attach.html Transactions involving multiple attached databases are atomic, assuming that the main database is not :memory:. It then goes on to say: If the

[sqlite] Transactions and attached databases

2009-02-25 Thread Tito Ciuro
Hello, If I attach one or more databases and wrap a series of operations which affect some/all of them, would ROLLBACK or COMMIT treat these operations atomically? For example: Open database 'foo'; Attach database 'bar' as a1; BEGIN TRANSACTION; INSERT INTO main.some_table ... ;

Re: [sqlite] Transactions and attached databases

2009-02-25 Thread Griggs, Donald
-Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Tito Ciuro Sent: Wednesday, February 25, 2009 6:36 PM To: sqlite-users@sqlite.org Subject: [sqlite] Transactions and attached databases Hello, If I attach one or more

Re: [sqlite] Transactions and attached databases

2009-02-25 Thread Tito Ciuro
Hi Donald, On Feb 25, 2009, at 3:39 PM, Griggs, Donald wrote: Greetings, Tito, Did you see page: http://www.sqlite.org/lang_attach.html Transactions involving multiple attached databases are atomic, assuming that the main database is not :memory:. It then goes on to say: If the

[sqlite] Transactions on attached databases

2008-12-12 Thread Marco Bambini
I have two databases, db1 and db2. At some point I attach db2 to db1 as 'destdb' then I do: sqlite3_exec(db1, BEGIN, ...); sqlite3_exec(db1, INSERT INTO destdb.table1 SELECT * FROM main.table1, ...); sqlite3_exec(db1, INSERT INTO destdb.table2 SELECT * FROM main.table2, ...);

Re: [sqlite] Transactions on attached databases

2008-12-12 Thread D. Richard Hipp
On Dec 12, 2008, at 11:16 AM, Marco Bambini wrote: I have two databases, db1 and db2. At some point I attach db2 to db1 as 'destdb' then I do: sqlite3_exec(db1, BEGIN, ...); sqlite3_exec(db1, INSERT INTO destdb.table1 SELECT * FROM main.table1, ...); sqlite3_exec(db1, INSERT INTO

Re: [sqlite] Transactions on attached databases

2008-12-12 Thread Marco Bambini
It's a very useful API, thanks a lot. -- Marco Bambini http://www.sqlabs.net http://www.sqlabs.net/blog/ http://www.sqlabs.net/realsqlserver/ On Dec 12, 2008, at 5:26 PM, D. Richard Hipp wrote: On Dec 12, 2008, at 11:16 AM, Marco Bambini wrote: I have two databases, db1 and db2. At

[sqlite] Transactions and Threads

2008-08-21 Thread Shawn Wilsher
Hey all, I'm looking to clarify the behavior of transactions when it comes to threads. When using the same sqlite3 object, and you begin a transaction on one thread, does it also group work that is being done on another thread until you end the transaction? Or is it the case that each thread

Re: [sqlite] Transactions and Threads

2008-08-21 Thread Igor Tandetnik
Shawn Wilsher [EMAIL PROTECTED] wrote: I'm looking to clarify the behavior of transactions when it comes to threads. When using the same sqlite3 object, and you begin a transaction on one thread, does it also group work that is being done on another thread until you end the transaction? Yes.

[sqlite] Transactions on a shared database connection

2007-11-06 Thread John Firebaugh
With SQLite 3.5.1, when a connection is shared between two threads, if the second thread attempts to begin a transaction while a transaction is in progress on the first thread, sqlite3_exec( begin transaction ) returns SQLITE_ERROR with a status message cannot start a transaction within a

[sqlite] Transactions across attached databases

2006-10-18 Thread Nakarada, Bob
Could someone definitively answer the following question about version 2.8 of SQLite and transactions on an attached database? Following is pseudo code' for the type of transactions we issue. The statement to the table in the attached database sometimes fails with a busy error; the busy wait

Re: [sqlite] Transactions across attached databases

2006-10-18 Thread drh
Nakarada, Bob [EMAIL PROTECTED] wrote: Could someone definitively answer the following question about version 2.8 of SQLite and transactions on an attached database? Is this expected behaviour? At this point the expected behavior of 2.8 is whatever it does. If somebody finds a bug in

RE: [sqlite] Transactions and 'library routine called out of sequence' locks the database

2006-05-10 Thread Michael B. Hansen
:) /Michael -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 9. maj 2006 12:26 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Transactions and 'library routine called out of sequence' locks the database Michael B. Hansen [EMAIL PROTECTED] wrote: However

RE: [sqlite] Transactions and 'library routine called out of sequence' locks the database

2006-05-09 Thread Michael B. Hansen
continues. -Original Message- From: Dennis Cote [mailto:[EMAIL PROTECTED] Sent: 8. maj 2006 17:12 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Transactions and 'library routine called out of sequence' locks the database Michael B. Hansen wrote: I use my own global locking-mechanism, so

Re: [sqlite] Transactions and 'library routine called out of sequence' locks the database

2006-05-09 Thread drh
Michael B. Hansen [EMAIL PROTECTED] wrote: However, I keep getting 'library routine called out of sequence' at random interval. This is caused when you do things like try to use a database connection that has already been closed or try to use a prepared statement that has already been

[sqlite] Transactions and 'library routine called out of sequence' locks the database

2006-05-08 Thread Michael B. Hansen
Hi, I have this problem - that keeps hunting me. I use SQLite 3.3.5 - with all queries, updates and inserts in transactions. I use my own global locking-mechanism, so only one connection can be opened at one time. However, I keep getting 'library routine called out of sequence' at random

Re: [sqlite] Transactions and 'library routine called out of sequence' locks the database

2006-05-08 Thread Dennis Cote
Michael B. Hansen wrote: I use my own global locking-mechanism, so only one connection can be opened at one time. Michael, Is it possible that your own locking mechanism is failing? You haven't said how the locks are implemented, and getting mutual exclusion stuff right in roll your own

Re: [sqlite] Transactions and sqlite3_last_insert_rowid

2006-04-19 Thread Dennis Cote
Michael Ekstrand wrote: [EMAIL PROTECTED] wrote: The ROWID is generated after the BEFORE triggers fire and before the row is inserted. OK, I think I'm getting it. The INSERT statement generates the ROWID, fires triggers, then inserts the row. When the transaction is committed, all

Re: [sqlite] Transactions and sqlite3_last_insert_rowid

2006-04-18 Thread Michael Ekstrand
Will Leshner wrote: On 4/17/06, Michael Ekstrand [EMAIL PROTECTED] wrote: So, if someone could enlighten me as to the defined behavior of sqlite3_last_insert_rowid with regards to transactions, I would be most grateful. The last insert id is a property of a connection. So there is no way

Re: [sqlite] Transactions and sqlite3_last_insert_rowid

2006-04-18 Thread drh
Michael Ekstrand [EMAIL PROTECTED] wrote: Will Leshner wrote: On 4/17/06, Michael Ekstrand [EMAIL PROTECTED] wrote: So, if someone could enlighten me as to the defined behavior of sqlite3_last_insert_rowid with regards to transactions, I would be most grateful. The last insert id

Re: [sqlite] Transactions and sqlite3_last_insert_rowid

2006-04-18 Thread Michael Ekstrand
[EMAIL PROTECTED] wrote: The ROWID is generated after the BEFORE triggers fire and before the row is inserted. OK, I think I'm getting it. The INSERT statement generates the ROWID, fires triggers, then inserts the row. When the transaction is committed, all that is committed; when the

[sqlite] Transactions and sqlite3_last_insert_rowid

2006-04-17 Thread Michael Ekstrand
I'm trying to figure out how sqlite3_last_insert_rowid() interacts with transactions. I've read the thread at http://www.mail-archive.com/sqlite-users@sqlite.org/msg13393.html However, the concern raised in the last message of that thread is exactly my concern, and was never addressed in the

Re: [sqlite] Transactions and sqlite3_last_insert_rowid

2006-04-17 Thread Will Leshner
On 4/17/06, Michael Ekstrand [EMAIL PROTECTED] wrote: So, if someone could enlighten me as to the defined behavior of sqlite3_last_insert_rowid with regards to transactions, I would be most grateful. The last insert id is a property of a connection. So there is no way that one connection can

Re: [sqlite] Transactions

2005-10-06 Thread Jens Miltner
Am 05.10.2005 um 13:17 schrieb Christian Smith: On Tue, 4 Oct 2005, Martin Engelschalk wrote: Hello Christian, thank you, but synchronous is already off. What i aim to avoid is writing the rollback - journal. In order to rollback, some additional writing to disk is surely unaviodable.

Re: [sqlite] Transactions

2005-10-06 Thread Christian Smith
On Thu, 6 Oct 2005, Jens Miltner wrote: Am 05.10.2005 um 13:17 schrieb Christian Smith: On Tue, 4 Oct 2005, Martin Engelschalk wrote: Hello Christian, thank you, but synchronous is already off. What i aim to avoid is writing the rollback - journal. In order to rollback, some additional

Re: [sqlite] Transactions

2005-10-05 Thread Christian Smith
On Tue, 4 Oct 2005, Martin Engelschalk wrote: Hello Christian, thank you, but synchronous is already off. What i aim to avoid is writing the rollback - journal. In order to rollback, some additional writing to disk is surely unaviodable. You'll have to write your own pager layer, as there is

[sqlite] Transactions

2005-10-04 Thread Martin Engelschalk
Hi all, it may sound strange, but I do not need transactions. Also i do not care if the database is corrupted in case of a program or system crash. So: is it possible to disable transactions in sqlite? Mr. Mark Allan semms to have done this. Could i speed up my writes this way? Thanks,

[sqlite] Transactions

2005-10-04 Thread Martin Engelschalk
Hi all, it may sound strange, but I do not need transactions. Also i do not care if the database is corrupted in case of a program or system crash. So: is it possible to disable transactions in sqlite? Mr. Mark Allan seems to have done this. Could i speed up my writes this way? Thanks,

Re: [sqlite] Transactions

2005-10-04 Thread Christian Smith
On Tue, 4 Oct 2005, Martin Engelschalk wrote: Hi all, it may sound strange, but I do not need transactions. Also i do not care if the database is corrupted in case of a program or system crash. So: is it possible to disable transactions in sqlite? Mr. Mark Allan seems to have done this. Could i

Re: [sqlite] Transactions

2005-10-04 Thread Martin Engelschalk
Hello Christian, thank you, but synchronous is already off. What i aim to avoid is writing the rollback - journal. In order to rollback, some additional writing to disk is surely unaviodable. Martin Christian Smith schrieb: On Tue, 4 Oct 2005, Martin Engelschalk wrote: Hi all, it

[sqlite] Transactions and in-memory databases

2005-03-31 Thread Cory Nelson
If I open two handles to sqlite.db, and attach a :memory: database to one of them, then start a transaction on the handle without the :memory: database, will this prevent me from using the :memory: database in the other handle until the transaction finishes? -- Cory Nelson http://www.int64.org

Re: [sqlite] Transactions and in-memory databases

2005-03-31 Thread Dan Kennedy
--- Cory Nelson [EMAIL PROTECTED] wrote: If I open two handles to sqlite.db, and attach a :memory: database to one of them, then start a transaction on the handle without the :memory: database, will this prevent me from using the :memory: database in the other handle until the transaction

Re: [sqlite] Transactions and in-memory databases

2005-03-31 Thread Dan Kennedy
--- Dan Kennedy [EMAIL PROTECTED] wrote: --- Cory Nelson [EMAIL PROTECTED] wrote: If I open two handles to sqlite.db, and attach a :memory: database to one of them, then start a transaction on the handle without the :memory: database, will this prevent me from using the :memory: