Also, I seem to recall on swiki that even reads benefit from transaction
wrapping.  Like Christian, I have wrapped any  series of reads where the
data need to be consistent (at that moment, as opposed to database
consistency).  I would welcome a BEGIN (READONLY) statement.

---Keith

******************************************************
- I'm not a professional; I just get paid to do this.

- Things I've learned about multithreaded programming:

    123...   PPArrvooottieedcc ttm  ueelvvteeirrtyyhtt
rhheiianndgge  dwi hnpi rctohhg eri aslm omscitanalgt 
 iowcbh,je engceltvo ebwrah lip,co hso srci abonlt ehb
.ee^Nr waicscee snsoetd  'aotb jtehcet -slaomcea lt'il
m^Ne from two or more threads
******************************************************

-----Original Message-----
From: Christian Smith [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 01, 2004 7:00 AM
To: [EMAIL PROTECTED]
Subject: Re: [sqlite] Locking in 3.0.5


On Wed, 1 Sep 2004, Matt Wilson wrote:

>On Wed, Sep 01, 2004 at 02:46:39PM +0100, Christian Smith wrote:
>>
>> Add a new "BEGIN [TRANSACTION] FOR READONLY" statement, which begins 
>> the transaction with a read lock only and doesn't allow the 
>> transaction to even try to promote to a write lock.
>
>Why do you need a transaction at all if you're not going to commit?
>
>In my code, readers never use BEGIN, only writers do.


A transaction gives you a snapshot in time of the database. You may need
to do more than one query, and require a consistent snapshot for the
duration of the multiple queries.


>
>Cheers,
>
>Matt
>

-- 
    /"\
    \ /    ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
     X                           - AGAINST MS ATTACHMENTS
    / \

Reply via email to