"Wei Chin" <[EMAIL PROTECTED]> writes:

> As I try this with SQLITE 3.0.4, I get "database is locked" error at 
> step 4.
>
> Are you not getting the lock out error?

Yes, because there is a transaction in progress in Process 2, the database may
not be written to by Process 1, so without a busy-wait-time value specified,
the INSERT query at step 4 will return a BUSY error.  If you have a
busy-wait-timeout (handler) specified, step 4 will wait until after the
transaction is ended in step 5, and then the INSERT at step 4 will proceed
i.e. although it's the command is issued at time 4, it wont actually be
executed until time 6 -- assuming the busy-wait handler waits that long for
the database to be unlocked.

>
> [EMAIL PROTECTED] wrote on 9/1/2004, 10:04 AM:
>
>  > Time    Process 1                                     Process 2
>  > ---------------------------------------------------------------
>  > 1      INSERT INTO t1
>  >           VALUES (1, 'one');
>  >
>  > 2      INSERT INTO t2
>  >           VALUES ('hello', 'world');
>  >
>  > 3                                                    BEGIN;
>  >                                                       SELECT * FROM t2;
>  >
>  > 4      INSERT INTO t1
>  >           VALUES (2, 'two');
>  >
>  > 5                                                    SELECT * FROM t1;
>  >                                                       END TRANSACTION;

Reply via email to