journal mode and transactions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

journal mode and transactions

Nelson, Erik - 2
The transactions documentation (https://sqlite.org/lang_transaction.html) states

   >If PRAGMA journal_mode is set to OFF (thus disabling the rollback journal file) then the behavior of the ROLLBACK command is undefined.

Does that correspondingly mean there's no performance benefit to wrapping operations in a transaction?  Is that true for in-memory databases as well?

----------------------------------------------------------------------
This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer.   If you are not the intended recipient, please delete this message.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: journal mode and transactions

David Raymond
In memory databases can have rollbacks if they're using journal mode memory. The last sentence there is a little confusing...

"Note that the journal_mode for an in-memory database is either MEMORY or OFF and can not be changed to a different value. An attempt to change the journal_mode of an in-memory database to any setting other than MEMORY or OFF is ignored. Note also that the journal_mode cannot be changed while a transaction is active"

...it seems to say you can't change it, but then says if you do change it...

For the transaction benefits you might be right, or it might be the case where having them in a transaction saves some disk flushes while it's going on. I.e. in both autocommit and journal_mode off you'll be making changes directly to the main file with no rollback journals. But with autocommit it'll be syncing the file after each statement whereas with the transaction it might wait until the commit to sync. Not sure on that though.

An in memory database with journal_mode off I'm pretty sure will see no benefits from transactions.

These are my edumacated guesses anyway. Please trust the actual experts more than me.


-----Original Message-----
From: sqlite-users [mailto:[hidden email]] On Behalf Of Nelson, Erik - 2
Sent: Friday, December 22, 2017 11:10 AM
To: SQLite mailing list
Subject: [sqlite] journal mode and transactions

The transactions documentation (https://sqlite.org/lang_transaction.html) states

   >If PRAGMA journal_mode is set to OFF (thus disabling the rollback journal file) then the behavior of the ROLLBACK command is undefined.

Does that correspondingly mean there's no performance benefit to wrapping operations in a transaction?  Is that true for in-memory databases as well?

----------------------------------------------------------------------
This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer.   If you are not the intended recipient, please delete this message.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users