Changeset 48894 in webkit
- Timestamp:
- Sep 29, 2009 1:05:11 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r48893 r48894 1 2009-09-29 Dumitru Daniliuc <dumi@chromium.org> 2 3 Reviewed by Dimitri Glazkov. 4 5 Starting all read-only transactions with an explicit BEGIN 6 DEFERRED command instead of BEGIN, since some ports (chromium) 7 might compile their own SQLite library and set BEGIN to BEGIN 8 IMMEDIATE by default; which would result in a deadlock in case of 9 two concurrent read-only transactions on the same DB, and would 10 unnecessarily delay other potential transactions to the same DB. 11 12 https://bugs.webkit.org/show_bug.cgi?id=29729 13 14 * platform/sql/SQLiteTransaction.cpp: 15 (WebCore::SQLiteTransaction::begin): 16 1 17 2009-09-29 Kenneth Russell <kbr@google.com> 2 18 -
trunk/WebCore/platform/sql/SQLiteTransaction.cpp
r48617 r48894 48 48 if (!m_inProgress) { 49 49 ASSERT(!m_db.m_transactionInProgress); 50 // Call BEGIN IMMEDIATE for a write transaction to acquire 51 // a RESERVED lock on the DB file. Otherwise, another write 52 // transaction (on another connection) could make changes 53 // to the same DB file before this transaction gets to execute 54 // any statements. If that happens, this transaction will fail. 50 // For read-only transactions, call BEGIN DEFERRED explicitly. 51 // Otherwise, a port might use a SQLite library that was build 52 // to interpret BEGIN as BEGIN IMMEDIATE, which would lead to 53 // a deadlock whenever two read transactions on the same DB 54 // are scheduled concurrently. 55 // For write transactions, call BEGIN IMMEDIATE to acquire 56 // a RESERVED lock on the DB file before the transaction 57 // callback is executed. Otherwise, another write transaction 58 // (on another connection) could make changes to the same DB file 59 // before this transaction gets to execute any statements. 60 // If that happens, this transaction will fail. 55 61 // http://www.sqlite.org/lang_transaction.html 56 62 // http://www.sqlite.org/lockingv3.html#locking 57 63 if (m_readOnly) 58 m_inProgress = m_db.executeCommand("BEGIN ;");64 m_inProgress = m_db.executeCommand("BEGIN DEFERRED;"); 59 65 else 60 66 m_inProgress = m_db.executeCommand("BEGIN IMMEDIATE;");
Note: See TracChangeset
for help on using the changeset viewer.