Re: [sqlite] Nested transaction

2012-02-06 Thread Jay A. Kreibich
On Mon, Feb 06, 2012 at 08:20:48PM +0530, Sreekumar TP scratched on the wall: > so if stmt1 & stmt2 are executed on different threads , but on the same > connection, they would not block each other? They would not block each other due to database access locks. They may or may not block each

Re: [sqlite] Nested transaction

2012-02-06 Thread Sreekumar TP
so if stmt1 & stmt2 are executed on different threads , but on the same connection, they would not block each other? Sreekumar On Feb 6, 2012 8:08 PM, "Igor Tandetnik" wrote: > Sreekumar TP wrote: > > well, if stmt1 is a write transaction, it would

Re: [sqlite] Nested transaction

2012-02-06 Thread Igor Tandetnik
Sreekumar TP wrote: > well, if stmt1 is a write transaction, it would aquire an exclusive lock. > if stmt2 is a read transaction, it would fail acquiring a shared lock The concept of a transaction exists on a per-connection basis, not per-statement. Transaction isolation

Re: [sqlite] Nested transaction

2012-02-06 Thread Jay A. Kreibich
On Mon, Feb 06, 2012 at 07:46:18PM +0530, Sreekumar TP scratched on the wall: > well, if stmt1 is a write transaction, it would aquire an exclusive lock. > if stmt2 is a read transaction, it would fail acquiring a shared lock since > the exclusive lock is not released. . unless sqlite decides to

Re: [sqlite] Nested transaction

2012-02-06 Thread Sreekumar TP
well, if stmt1 is a write transaction, it would aquire an exclusive lock. if stmt2 is a read transaction, it would fail acquiring a shared lock since the exclusive lock is not released. . unless sqlite decides to 'downgrade' the exclusive lock to a 'shared' lock. Sreekumar On Feb 6, 2012 7:07 PM,

Re: [sqlite] Nested transaction

2012-02-06 Thread Igor Tandetnik
Sreekumar TP wrote: > Why is this treated as a a single transaction? Well, because that's how SQLite works. Why shouldn't it be? -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Nested transaction

2012-02-06 Thread Sreekumar TP
Why is this treated as a a single transaction? Sreekumar On Feb 6, 2012 6:27 PM, "Igor Tandetnik" wrote: > Sreekumar TP wrote: > > I have a nested transaction as follows - > > > > sqlite3_prepare_v2(db, stmt1..) > > sqlite3_prepare_v2(db, stmt2..) >

Re: [sqlite] Nested transaction

2012-02-06 Thread Richard Hipp
On Mon, Feb 6, 2012 at 7:57 AM, Igor Tandetnik wrote: > Sreekumar TP wrote: > > I have a nested transaction as follows - > > > > sqlite3_prepare_v2(db, stmt1..) > > sqlite3_prepare_v2(db, stmt2..) > > > > sqlite3_step(stmt1) > > sqlite3_step(stmt2)

Re: [sqlite] Nested transaction

2012-02-06 Thread Igor Tandetnik
Sreekumar TP wrote: > I have a nested transaction as follows - > > sqlite3_prepare_v2(db, stmt1..) > sqlite3_prepare_v2(db, stmt2..) > > sqlite3_step(stmt1) > sqlite3_step(stmt2) > sqlite3_reset(stmt2) > sqlite3_step(stmt1) There is only one transaction here - an

[sqlite] Nested transaction

2012-02-06 Thread Sreekumar TP
Hi, I have a nested transaction as follows - sqlite3_prepare_v2(db, stmt1..) sqlite3_prepare_v2(db, stmt2..) sqlite3_step(stmt1) sqlite3_step(stmt2) sqlite3_reset(stmt2) sqlite3_step(stmt1) (1) SQLITE , as I understand does not support nested transaction, hence the the above statement