File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 201201 _this . openDBs [ _this . dbname ] . state = DB_STATE_OPEN ;
202202 _this . openDBs [ _this . dbname ] . connections . push ( connectionName ) ;
203203 }
204+
205+ var callSuccessAndStartTransaction = function ( ) {
206+ if ( ! ! success ) {
207+ success ( _this ) ;
208+ }
209+ txLock = txLocks [ _this . dbname ] ;
210+ if ( ! ! txLock && txLock . queue . length > 0 ) {
211+ _this . startNextTransaction ( ) ;
212+ }
213+ } ;
214+
204215 if ( maxConnections > 1 ) {
205216 // Otherwise readers will be blocked by writers
206- _this . executeSql ( 'PRAGMA journal_mode = WAL;' , [ ] ) ;
207- }
208- if ( ! ! success ) {
209- success ( _this ) ;
210- }
211- txLock = txLocks [ _this . dbname ] ;
212- if ( ! ! txLock && txLock . queue . length > 0 ) {
213- _this . startNextTransaction ( ) ;
217+ _this . executeSql ( 'PRAGMA journal_mode = WAL;' , [ ] , callSuccessAndStartTransaction ) ;
218+ } else {
219+ callSuccessAndStartTransaction ( ) ;
214220 }
221+
215222 } ;
216223 } ;
217224 } ) ( this ) ;
You can’t perform that action at this time.
0 commit comments