Re: [sqlite] Transaction commits hangs up

2018-12-11 Thread Shawn Wagner
Do you still have the issue with a current version of the library? On Tue, Dec 11, 2018, 12:53 AM Aydin Ozgur Yagmur I have been using sqlite3.8.11 on fat32 file system. Sometimes, while > committing a transaction commit process hangs up and database became > locked. I am trying to find a cause

[sqlite] Transaction commits hangs up

2018-12-11 Thread Aydin Ozgur Yagmur
I have been using sqlite3.8.11 on fat32 file system. Sometimes, while committing a transaction commit process hangs up and database became locked. I am trying to find a cause or a solution for this problem. Does anyone encounter with similar problem before? Do you have any suggestion or any idea

Re: [sqlite] transaction during reading on read-only database

2016-10-06 Thread Klaas Van B.
Ciao Andri, To keep the results of a query consistent one better starts a transaction. A database can be updated by one thread at a time, but read by many. Suppose you need a list of all employees of a department. If you start to search one at a time a lot of changes can happen. An employee can

Re: [sqlite] transaction during reading on read-only database

2016-10-06 Thread Dominique Pellé
Andrii Motsok wrote: > Hi, > > > My understanding is that any reading from database automatically > starts read transaction. The question: why does sqlite need to do it on > read-only database? > > > Regards, > > Andrii You may open a database as read-only, but

[sqlite] transaction during reading on read-only database

2016-10-06 Thread Andrii Motsok
Hi, My understanding is that any reading from database automatically starts read transaction. The question: why does sqlite need to do it on read-only database? Regards, Andrii ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

[sqlite] SQLite transaction time limit

2015-07-13 Thread Iryna Atamanova
Hi guys, We have found the next feature of sqllite - it transaction takes more that 5 seconds, the database has been locked for some time. Could you please help us and let me know how we can increase this time - 5 seconds to 30 for example (what parameter / attribute can be used?) from source

[sqlite] SQLite transaction time limit

2015-07-08 Thread Paul
You are probably asking for 8 July 2015, 15:24:18, by "Iryna Atamanova" : > Hi guys, > > I will be very appreciate for your help. > > We have found the next feature of sqllite - it transaction takes more that > 5 seconds, the database has

[sqlite] SQLite transaction time limit

2015-07-08 Thread Iryna Atamanova
Hi guys, I will be very appreciate for your help. We have found the next feature of sqllite - it transaction takes more that 5 seconds, the database has been locked for some time. Could you please help us and let me know how we can increase this time - 5 seconds to 30 for example (what parameter

[sqlite] SQLite transaction time limit

2015-07-08 Thread Kevin Benson
http://permalink.gmane.org/gmane.comp.db.sqlite.general/91411 'In the connection string, please use "Default Timeout"...' *SNIP* 'Also, the "Default Timeout" value is measured in seconds, so it would be...' *SNIP* -> 30 in your case. -- -- -- --???-- K e V i N On

Re: [sqlite] Transaction issues with WinRT build

2014-07-25 Thread pantelis.geo
Hello, Could you please provide some example of your code? I would like to see in what order the commands of the transaction are before you insert data to the database. It would be very helpful. begin transaction queries commit/rollback Thank you. -- View this message in context:

Re: [sqlite] transaction in one thread and other thread also trying to write data

2014-05-13 Thread J Decker
It works best to have a connection per thread. On Tue, May 13, 2014 at 6:12 AM, d b wrote: > Hi all, > > >My application is multithreaded. It maintains only connection per > application. Database accessed by single process only. ThreadA will do > database write

Re: [sqlite] transaction in one thread and other thread also trying to write data

2014-05-13 Thread Igor Tandetnik
On 5/13/2014 9:12 AM, d b wrote: My application is multithreaded. It maintains only connection per application. Database accessed by single process only. ThreadA will do database write operations(bulk) in a transaction. ThreadB will do single write operation without transaction but same

Re: [sqlite] transaction in one thread and other thread also trying to write data

2014-05-13 Thread Constantine Yannakopoulos
On Tue, May 13, 2014 at 4:12 PM, d b wrote: >My application is multithreaded. It maintains only connection per > application. Database accessed by single process only. ThreadA will do > database write operations(bulk) in a transaction. ThreadB will do single > write

[sqlite] transaction in one thread and other thread also trying to write data

2014-05-13 Thread d b
Hi all, My application is multithreaded. It maintains only connection per application. Database accessed by single process only. ThreadA will do database write operations(bulk) in a transaction. ThreadB will do single write operation without transaction but same connection pointer. Here,

Re: [sqlite] Transaction behaviour

2014-01-23 Thread Joseph L. Casale
> SQLite transaction is a property of a database connection - there ain't > no such thing as a transaction spanning multiple connections. In hindsight, I completely overlooked that very point. Between then and now it's all been refactored to do this correctly. Thanks everybod

Re: [sqlite] Transaction behaviour

2014-01-23 Thread Igor Tandetnik
On 1/23/2014 5:12 PM, Joseph L. Casale wrote: The bulk load doesn't have to be done this way, only one process loads data and even a single connection can be used but that would segment the wrapper. SQLite transaction is a property of a database connection - there ain't no such thing

Re: [sqlite] Transaction behaviour

2014-01-23 Thread Joseph L. Casale
> Start the bulk load with "BEGIN IMMEDIATE;" or "BEGIN > EXCLUSIVE;" and count errors. > If there were no errors at the end of the bulk load, issue > "COMMIT;", else issue "ROLLBACK". > If the program crashes, sqlite will take care of the rollback > automatically the next time any process opens

Re: [sqlite] Transaction behaviour

2014-01-23 Thread Kees Nuyt
On Thu, 23 Jan 2014 16:30:57 +, "Joseph L. Casale" wrote: >I have a scenario where I am writing a series of entries across several tables >with relationships using Python and context managers. The sql is abstracted >away from the user by a class providing all the

Re: [sqlite] Transaction behaviour

2014-01-23 Thread Igor Tandetnik
On 1/23/2014 11:30 AM, Joseph L. Casale wrote: is there anything about transactions I am not seeing where I can accomplish leaving the bulk load uncommitted in the event of an issue in my case? I'm not sure I understand the nature of the difficulty. If you don't want to COMMIT a transaction,

[sqlite] Transaction behaviour

2014-01-23 Thread Joseph L. Casale
I have a scenario where I am writing a series of entries across several tables with relationships using Python and context managers. The sql is abstracted away from the user by a class providing all the needed methods. These each open implicit transactions, now its been asked that during the bulk

Re: [sqlite] Transaction involving multiple attached databases

2013-11-26 Thread Hick Gunter
. November 2013 20:25 An: sqlite-users@sqlite.org Betreff: [sqlite] Transaction involving multiple attached databases Hello all, If I have multiple databases attached and then do a: BEGIN EXCLUSIVE I assume all the sqlite3 tables involved get locked? Is there a way to lock only one of the attached tables

Re: [sqlite] Transaction involving multiple attached databases

2013-11-26 Thread Peter Aronson
And you can't execute it at all if any of the attached databases are read-only.   Peter >On 11/26/2013 2:24 PM, Joshua Grauman wrote: >> If I have multiple databases attached and then do a: >> BEGIN EXCLUSIVE >> >> I assume all the sqlite3 tables involved get locked? > >All the database files

Re: [sqlite] Transaction involving multiple attached databases

2013-11-26 Thread Igor Tandetnik
On 11/26/2013 2:24 PM, Joshua Grauman wrote: If I have multiple databases attached and then do a: BEGIN EXCLUSIVE I assume all the sqlite3 tables involved get locked? All the database files are locked. Is there a way to lock only one of the attached tables? I'm pretty sure there isn't,

[sqlite] Transaction involving multiple attached databases

2013-11-26 Thread Joshua Grauman
Hello all, If I have multiple databases attached and then do a: BEGIN EXCLUSIVE I assume all the sqlite3 tables involved get locked? Is there a way to lock only one of the attached tables? Thanks. ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] Transaction Handling

2013-07-31 Thread techi eth
Is it possible to use Sqlite3 transaction capability based on actual return of individual transaction query execution? Example: BEGIN SELECT for reading the database (Here I will get data in my read call back function Based on data status I may initiate other transaction, like below Update)

Re: [sqlite] Transaction

2013-06-08 Thread Simon Slavin
On 8 Jun 2013, at 5:27pm, RSmith wrote: > Thank you very much for taking the time - this did answer my question. You're welcome. > If I may one more question related to this: Let's say I am using > transactions as validation stops on a long list of inputs - So > that the

Re: [sqlite] Transaction

2013-06-08 Thread RSmith
Apologies, this went to wrong mailbox first... -- Thank you very much for taking the time - this did answer my question. If I may one more question related to this: Let's say I am using transactions as validation stops on a long list of

Re: [sqlite] Transaction

2013-06-08 Thread Simon Slavin
On 8 Jun 2013, at 3:35pm, RSmith wrote: > A) so to have: > BEGIN > SAVEPOINT A > ... > RELEASE A > SAVEPOINT B > ... > RELEASE B > ... > COMMIT; > > B) or to have: > BEGIN > SAVEPOINT A > ... >SAVEPOINT B > ... >RELEASE B > ... > RELEASE A > COMMIT;

Re: [sqlite] Transaction

2013-06-08 Thread RSmith
Ugh, of course, stupid mistake in explanation - Of course it must be SAVEPOINT, not again BEGIN. A) so to have: BEGIN SAVEPOINT A ... RELEASE A SAVEPOINT B ... RELEASE B ... COMMIT; B) or to have: BEGIN SAVEPOINT A ... SAVEPOINT B ... RELEASE B ... RELEASE A

Re: [sqlite] Transaction

2013-06-08 Thread Igor Tandetnik
On 6/8/2013 10:17 AM, RSmith wrote: Could someone please shortly discuss performance considerations for having nested Transactions vs. sequential transactions in SQLite. There ain't no such thing as a nested transaction. The second BEGIN statement will simply fail. -- Igor Tandetnik

[sqlite] Transaction

2013-06-08 Thread RSmith
Hi all, I've read some of the standard help on sqlite.org but have not studied the code at all, so turning to the experts for some advice (there is no urgency, I would just really like some insight). Could someone please shortly discuss performance considerations for having nested

Re: [sqlite] Transaction question

2013-04-26 Thread Igor Tandetnik
On 4/26/2013 7:18 PM, Igor Korot wrote: If I'm inside transaction and want to insert a record, will I see right after executing sqlite3_step() or I have to execute a "COMMIT" statement to see it? The connection that executed sqlite3_step() would see its own changes right away. Other

[sqlite] Transaction question

2013-04-26 Thread Igor Korot
Hi, ALL, If I'm inside transaction and want to insert a record, will I see right after executing sqlite3_step() or I have to execute a "COMMIT" statement to see it? Thank you. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] transaction commit is successful despite I/O error

2012-10-25 Thread Pavel Ivanov
I guess this can stand as one more argument for not using SQLite over NFS. Another argument could be found here: http://www.sqlite.org/lockingv3.html#how_to_corrupt. Pavel On Wed, Oct 24, 2012 at 2:01 PM, Efim Dyadkin wrote: > I was probably not quite specific. So I

Re: [sqlite] transaction commit is successful despite I/O error

2012-10-25 Thread Efim Dyadkin
I was probably not quite specific. So I would like to rephrase the problem and give more details. I run a default configuration of Sqlite on Linux and I don't use WAL or anything that changes transaction behavior. A database is located on a remote file server and accessed via NFS. There is a

Re: [sqlite] Transaction inside transaction

2012-10-22 Thread Clemens Ladisch
Igor Korot wrote: > On Sun, Oct 21, 2012 at 11:01 PM, Darren Duncan > wrote: >> If you want a rollback on the inner to rollback the outer unconditionally, >> you never needed a nested transaction in the first place, but rather just >> the one outer transaction 1, > > 1.

Re: [sqlite] Transaction inside transaction

2012-10-22 Thread Igor Korot
Darren, On Sun, Oct 21, 2012 at 11:01 PM, Darren Duncan wrote: > Igor Korot wrote: >> >> Hi, ALL, >> Is it possible to have transaction inside transaction? Will it be >> handled correctly? >> >> What I mean is: crate transaction 1 by issuing "BEGIN", create >>

Re: [sqlite] Transaction inside transaction

2012-10-22 Thread Darren Duncan
Igor Korot wrote: Hi, ALL, Is it possible to have transaction inside transaction? Will it be handled correctly? What I mean is: crate transaction 1 by issuing "BEGIN", create transaction 2 by issuing "BEGIN". Close transaction 2 by issuing either "COMMIT" or "ROLLBACK". If "ROLLBACK" is issued,

Re: [sqlite] Transaction inside transaction

2012-10-21 Thread Igor Korot
Dan, On Sun, Oct 21, 2012 at 9:40 PM, Dan Kennedy wrote: > On 10/22/2012 11:34 AM, Igor Korot wrote: >> >> Hi, ALL, >> Is it possible to have transaction inside transaction? Will it be >> handled correctly? >> >> What I mean is: crate transaction 1 by issuing "BEGIN",

Re: [sqlite] Transaction inside transaction

2012-10-21 Thread Dan Kennedy
On 10/22/2012 11:34 AM, Igor Korot wrote: Hi, ALL, Is it possible to have transaction inside transaction? Will it be handled correctly? What I mean is: crate transaction 1 by issuing "BEGIN", create transaction 2 by issuing "BEGIN". Close transaction 2 by issuing either "COMMIT" or "ROLLBACK".

[sqlite] Transaction inside transaction

2012-10-21 Thread Igor Korot
Hi, ALL, Is it possible to have transaction inside transaction? Will it be handled correctly? What I mean is: crate transaction 1 by issuing "BEGIN", create transaction 2 by issuing "BEGIN". Close transaction 2 by issuing either "COMMIT" or "ROLLBACK". If "ROLLBACK" is issued, issue "ROLLBACK" on

Re: [sqlite] transaction commit is successful despite I/O error

2012-10-20 Thread Ryan Johnson
On 19/10/2012 4:40 PM, Efim Dyadkin wrote: Hi Richard, You are right about the purpose of unlink but it is out of context. There are a transaction in progress and hot journal on disk. If journal can't be deleted by the end of transaction, the transaction can't be considered to be

Re: [sqlite] transaction commit is successful despite I/O error

2012-10-20 Thread Dan Kennedy
On 10/20/2012 09:14 PM, Simon Slavin wrote: On 19 Oct 2012, at 9:40pm, Efim Dyadkin wrote: You are right about the purpose of unlink but it is out of context. There are a transaction in progress and hot journal on disk. If journal can't be deleted by the end of

Re: [sqlite] transaction commit is successful despite I/O error

2012-10-20 Thread Simon Slavin
On 19 Oct 2012, at 9:40pm, Efim Dyadkin wrote: > You are right about the purpose of unlink but it is out of context. There are > a transaction in progress and hot journal on disk. If journal can't be > deleted by the end of transaction, the transaction can't be

Re: [sqlite] transaction commit is successful despite I/O error

2012-10-20 Thread Efim Dyadkin
Hi Richard, You are right about the purpose of unlink but it is out of context. There are a transaction in progress and hot journal on disk. If journal can't be deleted by the end of transaction, the transaction can't be considered to be successfully finished. But current implementation of

Re: [sqlite] transaction commit is successful despite I/O error

2012-10-18 Thread Ryan Johnson
On 18/10/2012 8:45 AM, Richard Hipp wrote: On Wed, Oct 17, 2012 at 4:11 PM, Efim Dyadkin wrote: Hi, I am testing loss of data in Sqlite database correlated to auto-mounter malfunction. I am running Sqlite on Linux and my database file is located on network disk. For a

Re: [sqlite] transaction commit is successful despite I/O error

2012-10-18 Thread Richard Hipp
On Wed, Oct 17, 2012 at 4:11 PM, Efim Dyadkin wrote: > Hi, > > I am testing loss of data in Sqlite database correlated to auto-mounter > malfunction. I am running Sqlite on Linux and my database file is located > on network disk. For a test I stop the auto-mounter right

[sqlite] transaction commit is successful despite I/O error

2012-10-18 Thread Efim Dyadkin
Hi, I am testing loss of data in Sqlite database correlated to auto-mounter malfunction. I am running Sqlite on Linux and my database file is located on network disk. For a test I stop the auto-mounter right before transaction is committed. Surprisingly commit succeeds without any error

Re: [sqlite] Transaction issues with WinRT build

2012-08-21 Thread Lukas
Simon Slavin writes: > Is there a chance that you simply have an UPDATE command with a bad syntax ? You say it works fine on one > implementation of 3.7.13 but not the other ? I'm mystified by what you're seeing but I hope someone else can help. Thanks Simon, the update

Re: [sqlite] Transaction issues with WinRT build

2012-08-21 Thread Lukas
Joe Mistachkin writes: > Setting the sqlite3_temp_directory to the value contained in the > "Windows.Storage.ApplicationData.Current.TemporaryFolder.Path" property > should clear the issue. This can be done immediately after opening the > connection using PRAGMA temp_store_directory

Re: [sqlite] Transaction issues with WinRT build

2012-08-20 Thread Simon Slavin
On 19 Aug 2012, at 6:31pm, lukas wrote: > Simon Slavin writes: > >> Using both versions can you tell us the results of >> >> SELECT sqlite_version(),sqlite_source_id() > > Results are exactly the same for both dlls: > > 3.7.13 > 2012-06-11 02:05:22

Re: [sqlite] Transaction issues with WinRT build

2012-08-20 Thread lukas
Simon Slavin writes: > Using both versions can you tell us the results of > > SELECT sqlite_version(),sqlite_source_id() Results are exactly the same for both dlls: 3.7.13 2012-06-11 02:05:22 f5b5a13f7394dc143aa136f1d4faba6839eaa6dc The inserts are also in a transaction block.

Re: [sqlite] Transaction issues with WinRT build

2012-08-19 Thread Joe Mistachkin
Lukas Fellechner wrote: > > I tried using the WinRT builds of sqlite. But I find there are problems > when using transactions. While my table creation and insert statements work > fine, all transacted "update" statements are failing with result > "CannotOpen", error message is "unable to open

Re: [sqlite] Transaction issues with WinRT build

2012-08-19 Thread Simon Slavin
On 19 Aug 2012, at 3:38pm, "Lukas Fellechner" wrote: > I tried using the WinRT builds of sqlite. But I find there are problems > when using transactions. While my table creation and insert statements work > fine, all transacted "update" statements are failing with

[sqlite] Transaction issues with WinRT build

2012-08-19 Thread Lukas Fellechner
Hello, I tried using the WinRT builds of sqlite. But I find there are problems when using transactions. While my table creation and insert statements work fine, all transacted "update" statements are failing with result "CannotOpen", error message is "unable to open database file". This even

[sqlite] transaction when storing large and many files

2012-02-27 Thread Christoph P.U. Kukulies
I have a .NET C# application that is using System.Data.SQLite. The application goes through a filesystem and extracts file names, builds md5sums on every file and builds up a database. Reason behind is, to reduce the number of duplicates. The files as a tar file sum up to 66 GB. It's about a

Re: [sqlite] Transaction and SQLITE_CANTOPEN

2011-07-14 Thread Jay A. Kreibich
On Wed, Jul 13, 2011 at 03:52:55PM +0200, Romain Lahore-Carraté scratched on the wall: > Hi, > > I'm experiencing a weird issue and I don't know how to solve it. > First of all, I work on a multi platform middleware written in C language > that uses SQLite 3.7.5. > when I'm doing some tests on

[sqlite] Transaction and SQLITE_CANTOPEN

2011-07-14 Thread Romain Lahore-Carraté
Hi, I'm experiencing a weird issue and I don't know how to solve it. First of all, I work on a multi platform middleware written in C language that uses SQLite 3.7.5. when I'm doing some tests on Win32, everything is OK, but now I have to use this middleware on Android (compiled with android NDK

Re: [sqlite] Transaction triggers?

2011-05-12 Thread Nico Williams
I believe I've got solutions to the various little problems I've run into. My experiments have helped me shed some light on what the semantics of DB triggers should be, to the point where I think I've reached stable conclusions about those semantics. I'm also ready to characterize performance

Re: [sqlite] Transaction triggers?

2011-05-10 Thread Nico Williams
FWIW, I'm making progress. I've got BEGIN and COMMIT triggers firing, but there's issues related to auto-commit which imply that I need to be able to skip -at runtime- the trigger firing that I code with each OP_Transaction and OP_AutoCommit operation, which I think means I need a new op, but

Re: [sqlite] Transaction speed too slow?

2011-05-09 Thread Nick
l D. Black > > Senior Scientist > > NG Information Systems > > Advanced Analytics Directorate > > > > > From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on > behalf of Nick [maill...@css-uk.net] >

Re: [sqlite] Transaction triggers?

2011-05-09 Thread Nico Williams
I've researched firing of these triggers somewhat. Upshot: firing anything other than a transaction commit trigger is tricky. The semantics of transaction triggers are interesting. Presumably such triggers should execute in the same transaction as the one they are related to -- but this would

Re: [sqlite] Transaction speed too slow?

2011-05-09 Thread Black, Michael (IS)
-users@sqlite.org Subject: EXT :[sqlite] Transaction speed too slow? >From http://www.sqlite.org/faq.html#q19 it says "A transaction normally >requires two complete rotations of the disk platter, which on a 7200RPM disk >drive limits you to about 60 transactions per second."

Re: [sqlite] Transaction triggers?

2011-05-08 Thread Nico Williams
The reason to delay connection trigger firing to the first non-pragma statement would be to allow one to enable or disable db triggers. DB triggers should also be disabled by default, and ahould have a separate set of pragmas to enable or disable them. The main utility of connect triggers is to

Re: [sqlite] Transaction triggers?

2011-05-08 Thread Nico Williams
As for attached DBs, each DB gets its own db triggers. DB connect trigger firing should be about the same (first non-pragma statement affecting the attached db). ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Transaction triggers?

2011-05-08 Thread Nico Williams
On May 8, 2011 4:14 PM, "Roger Binns" wrote: > C) What about SAVEPOINT? Sounds useful... I should add that too. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Transaction triggers?

2011-05-08 Thread Nico Williams
Indeed, I have been thinking about when database connect fires. My current thought is: on the first non-pragma statement executed (not prepared), not at db open time. I only care about commit, really, but if I can I'll do the others too. ___

Re: [sqlite] Transaction triggers?

2011-05-08 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/08/2011 01:46 PM, Simon Slavin wrote: > Just asking to warn you it's tricky ... > > A) When do you consider that a transaction starts ? > B) How do you deal with ATTACHed databases ? C) What about SAVEPOINT? Roger -BEGIN PGP

[sqlite] Transaction speed too slow?

2011-05-08 Thread Nick
>From http://www.sqlite.org/faq.html#q19 it says "A transaction normally >requires two complete rotations of the disk platter, which on a 7200RPM disk >drive limits you to about 60 transactions per second." Using Linux/Ubuntu 10.04 on an otherwise idle Atom powered Nettop with a 5400RPM disk

Re: [sqlite] Transaction triggers?

2011-05-08 Thread Simon Slavin
On 8 May 2011, at 9:42pm, Nico Williams wrote: > CREATE TRIGGER ON BEGIN ... END; > > where is one of DATABASE CONNECT, DATABASE DISCONNECT, > TRANSACTION START, TRANSACTION COMMIT, and TRANSACTION ROLLBACK. Just asking to warn you it's tricky ... A) When do you consider that a transaction

Re: [sqlite] Transaction triggers?

2011-05-08 Thread Nico Williams
FWIW, I have parsing, automatic creation of the crutch views, and creation of the DB triggers working. Next up: firing of DB triggers. The changes so far are fairly trivial, adding very few branches, which means that writing tests for them should be relatively simple too. That said, it's taken

Re: [sqlite] Transaction triggers?

2011-05-06 Thread Nico Williams
It took just a few minutes to start on that approach. I have the necessary parse.y changes done and know what to do for the rest. Time to subscribe to sqlite-dev... ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Transaction triggers?

2011-05-06 Thread Nico Williams
BTW, I might implement and contribute something like this. I'm free to contribute any changes to SQLite3 that I make. I'd need some guidance though. And what I cannot contribute is the high degree of testing that SQLite3 is known for. The parsing aspect of database triggers is simple enough.

Re: [sqlite] Transaction triggers?

2011-05-06 Thread Nico Williams
On Fri, May 6, 2011 at 4:30 PM, Simon Slavin wrote: > On 6 May 2011, at 10:14pm, Nico Williams wrote: >> Here's what I need: >> >> - at transaction time I need a way to record somewhere that the >> transaction did start.  This would mostly be an insert into a table >> with

Re: [sqlite] Transaction triggers?

2011-05-06 Thread Simon Slavin
On 6 May 2011, at 10:14pm, Nico Williams wrote: > Here's what I need: > > - at transaction time I need a way to record somewhere that the > transaction did start. This would mostly be an insert into a table > with an INTEGER PRIMARY KEY AUTOINCREMENT column, and a time of > transaction start.

[sqlite] Transaction triggers?

2011-05-06 Thread Nico Williams
I really, really need transaction, not row, triggers. There's been discussion of those here in the past (IIRC D.R. Hipp had a proposal once). Here's what I need: - at transaction time I need a way to record somewhere that the transaction did start. This would mostly be an insert into a table

Re: [sqlite] "transaction" method of the Tcl bindings to SQLite

2011-03-24 Thread Dan Kennedy
On 03/24/2011 07:23 PM, Richard Hipp wrote: > On Wed, Mar 23, 2011 at 7:05 AM, Jean-Marie CUAZ wrote: > >> Hello, >> >> In a Tcl script, is it safe to call the Tcl "_return_" command inside >> and before the end of a multi-statement "_transaction_" method (for >> aborting the

Re: [sqlite] "transaction" method of the Tcl bindings to SQLite

2011-03-24 Thread Richard Hipp
On Wed, Mar 23, 2011 at 7:05 AM, Jean-Marie CUAZ wrote: > Hello, > > In a Tcl script, is it safe to call the Tcl "_return_" command inside > and before the end of a multi-statement "_transaction_" method (for > aborting the Tcl procedure in case of Sql/application error) ? > >

[sqlite] "transaction" method of the Tcl bindings to SQLite

2011-03-24 Thread Jean-Marie CUAZ
Hello, In a Tcl script, is it safe to call the Tcl "_return_" command inside and before the end of a multi-statement "_transaction_" method (for aborting the Tcl procedure in case of Sql/application error) ? In other words is the transaction handled at the SQLite level "closed" safely (and

[sqlite] Transaction Size

2010-11-14 Thread David Peters
Hi there, Could someone point me to the documentation that deals with optimizations of blocks of statements. I have a couple of databases of about 64Mbytes size and I want to understand how to optimize the processing of large numbers of statements. For example there are times when I need to

Re: [sqlite] Transaction isolation

2009-05-18 Thread Yang Zhang
Roger Binns wrote: > Yang Zhang wrote: >> Actually, this is only because Python 3 str is Python 2 unicode. Python >> 2 (which I'm currently using, and which I believe most of the world is >> using) str is a physical string of bytes, not a logical/decoded >> character string. Python 2.6

Re: [sqlite] Transaction isolation

2009-05-18 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Yang Zhang wrote: > Actually, this is only because Python 3 str is Python 2 unicode. Python > 2 (which I'm currently using, and which I believe most of the world is > using) str is a physical string of bytes, not a logical/decoded > character

Re: [sqlite] Transaction isolation

2009-05-18 Thread Yang Zhang
Igor Tandetnik wrote: > Yang Zhang wrote: >> Pavel Ivanov wrote: >>> BTW, ACID that you mentioned has nothing to do with snapshot >>> isolation that you want to achieve. AFAIK only Oracle supports this >>> kind of statement isolation level. >> Actually, Oracle, Postgresql,

Re: [sqlite] Transaction isolation

2009-05-18 Thread Igor Tandetnik
Yang Zhang wrote: > Pavel Ivanov wrote: >> BTW, ACID that you mentioned has nothing to do with snapshot >> isolation that you want to achieve. AFAIK only Oracle supports this >> kind of statement isolation level. > > Actually, Oracle, Postgresql, SQL Server, Firebird, and

Re: [sqlite] Transaction isolation

2009-05-18 Thread Yang Zhang
Pavel Ivanov wrote: > BTW, ACID that you mentioned has nothing to do with snapshot isolation > that you want to achieve. AFAIK only Oracle supports this kind of > statement isolation level. Actually, Oracle, Postgresql, SQL Server, Firebird, and others support snapshot isolation.

Re: [sqlite] Transaction isolation

2009-05-18 Thread Yang Zhang
Roger Binns wrote: > Yang Zhang wrote: >> I copied and pasted this code straight from my actual application, which >> uses blobs instead of integers, which I need to convert into strings >> (since Python interfaces with blobs using the `buffer` type, not `str`). > > And for very good reason.

Re: [sqlite] Transaction isolation

2009-05-18 Thread John Elrick
it to go into an endless loop >>> and failed (see below). My experiments seem to confirm that Sqlite >>> is >>> behaving as you expect, perhaps it is the wrapper which is not? >>> >>> >> Attempting this closer to the metal, it appears I w

Re: [sqlite] Transaction isolation

2009-05-18 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Yang Zhang wrote: > I copied and pasted this code straight from my actual application, which > uses blobs instead of integers, which I need to convert into strings > (since Python interfaces with blobs using the `buffer` type, not `str`). And for

Re: [sqlite] Transaction isolation

2009-05-18 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 John Elrick wrote: > Are you certain the wrapper is behaving that way? The pysqlite wrapper (available as a sqlite3 Python module) by default parses your SQL and starts and ends transactions behind your back, in order to make it look like SQLite

Re: [sqlite] Transaction isolation

2009-05-18 Thread D. Richard Hipp
ch is not? >> > > Attempting this closer to the metal, it appears I was mistaken. A > select from outside a transaction does indeed have visibility to rows > added inside the transaction. I would not have expected this > either, Yang. Double-check your findings, please

Re: [sqlite] Transaction isolation

2009-05-18 Thread John Elrick
John Elrick wrote: > SNIP > >>> I say this because your example implies that the Python wrapper starts >>> the transaction automatically inside the execute, and I would not be >>> surprised if it did so BEFORE executing the SQL parameter. >>> >>> >> The cursor() method that I call

Re: [sqlite] Transaction isolation

2009-05-18 Thread John Elrick
SNIP >> I say this because your example implies that the Python wrapper starts >> the transaction automatically inside the execute, and I would not be >> surprised if it did so BEFORE executing the SQL parameter. >> > > The cursor() method that I call on the conn for the SELECT should give

Re: [sqlite] Transaction isolation

2009-05-18 Thread Pavel Ivanov
SQLite doesn't support several simultaneous transactions on the same connection to database. So in fact your select and insert statements execute in the same transaction. And even more: your inserts are not committed until your select is completely finished. So for your task you should use

Re: [sqlite] Transaction isolation

2009-05-18 Thread Yang Zhang
Yang Zhang wrote: > John Elrick wrote: >> Yang Zhang wrote: >>> Roger Binns wrote: >>> Yang Zhang wrote: > for i in (str(row[0]) for row in conn.cursor().execute('SELECT key > FROM shelf ORDER BY ROWID')): > You are converting the key which is an integer

Re: [sqlite] Transaction isolation

2009-05-18 Thread Yang Zhang
John Elrick wrote: > Yang Zhang wrote: >> Roger Binns wrote: >> >>> Yang Zhang wrote: >>> for i in (str(row[0]) for row in conn.cursor().execute('SELECT key FROM shelf ORDER BY ROWID')): >>> You are converting the key which is an integer into a string for no >>>

Re: [sqlite] Transaction isolation

2009-05-18 Thread John Elrick
Yang Zhang wrote: > Roger Binns wrote: > >> Yang Zhang wrote: >> >>> for i in (str(row[0]) for row in conn.cursor().execute('SELECT key FROM >>> shelf ORDER BY ROWID')): >>> >> You are converting the key which is an integer into a string for no >> apparent reason. >> > > I

Re: [sqlite] Transaction isolation

2009-05-18 Thread Yang Zhang
Roger Binns wrote: > Yang Zhang wrote: >> for i in (str(row[0]) for row in conn.cursor().execute('SELECT key FROM >> shelf ORDER BY ROWID')): > > You are converting the key which is an integer into a string for no > apparent reason. I copied and pasted this code straight from my actual

Re: [sqlite] Transaction isolation

2009-05-18 Thread Igor Tandetnik
"Roger Binns" wrote in message news:4a1127e1.1040...@rogerbinns.com > If you also ask for the ROWID you will see that what is happening is a > new rowid is generated for the replaced row so that if you are > iterating over the table while modifying it then you effectively

Re: [sqlite] Transaction isolation

2009-05-18 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Yang Zhang wrote: > for i in (str(row[0]) for row in conn.cursor().execute('SELECT key FROM > shelf ORDER BY ROWID')): You are converting the key which is an integer into a string for no apparent reason. If you also ask for the ROWID you will see

[sqlite] Transaction isolation

2009-05-18 Thread Yang Zhang
Hi, for some reason the following program will loop forever: #!/usr/bin/env python import sqlite3 conn = sqlite3.connect(':memory:') conn.text_factory = bytes conn.execute('CREATE TABLE shelf (key INTEGER NOT NULL, value INTEGER NOT NULL)') for i in xrange(3): conn.execute('INSERT INTO

  1   2   3   >