> Cannot happen. If not executed within an implicit transaction, each
> SQL statement is effectively wrapped in a transaction all of its own.

So executing the insert/update/delete statement places RESERVED lock
right from the start before executing nested selects?

Pavel

On Tue, Aug 18, 2009 at 1:54 PM, Dan Kennedy<[email protected]> wrote:
>
> On Aug 19, 2009, at 12:35 AM, Pavel Ivanov wrote:
>
>> You can always do
>>
>> insert into table (id, count) values (?1, (select count(*) + 1 from
>> table where id = ?1))
>>
>> Though I'd be cautious about race condition that seems like possible
>> here when after select returned some value and before insert was made
>> another process made another insert with the same id...
>
> Cannot happen. If not executed within an implicit transaction, each
> SQL statement is effectively wrapped in a transaction all of its own.
>
> Dan.
>
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to