> Le 15 janv. 2016 ? 19:13, James K. Lowden <jklowden at schemamania.org> a 
> ?crit :
> 
>> Let a transaction (started with BEGIN TRANSACTION) which did only
>> reads. Is it any better to end it by COMMIT TRANSACTION or ROLLBACK
>> TRANSACTION, or is it completely insignificant?
> 
> Why not do the right thing and remove the begin & commit transaction
> statements?
> 
> An explicit transaction implies a unit of work, two or more changes to
> the database that must cohere for the database be consistent.
> Read-only operations (by which I suppose you mean SELECT) don't modify
> the database and don't belong in a transaction.


James, I appreciate and thank you for your answer, though I completely disagree.

a) There is always a transaction: either implicit or explicit.

b) I have many situations where running multiple statements within a single 
transaction, even though these statements are read-only (selects) is 
specifically wanted. When using WAL such readers do not block writers and write 
transactions committed after the read transaction began, are not seen by that 
read transaction. Allowing it to have a stable view on the whole database.  
Which is *very* important for some kind of work which can not easily expressed 
in a single select statement, however complex it is.

--
Meilleures salutations, Met vriendelijke groeten, Best Regards,
Olivier Mascia, integral.be/om


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: 
<http://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-users/attachments/20160115/1962271c/attachment.pgp>

Reply via email to