Skip to content

multiple cases for sqlite_busy  #483

@cgp1024

Description

@cgp1024

In later versions of sqlite, there's multiple SQLITE_BUSY flags:

define SQLITE_BUSY 5

define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8))

define SQLITE_BUSY_SNAPSHOT (SQLITE_BUSY | (2<<8))

so, generic error 133 or 517 could be reported.

instead of upgrading to the latest and adding these to the switch, i propose this change:
--- SQLiteStatementImpl.cpp.orig 2014-04-18 06:33:24.000000000 -0500
+++ SQLiteStatementImpl.cpp 2014-07-03 11:16:13.304507500 -0500
@@ -227,18 +227,14 @@
case SQLITE_LOCKED:
case SQLITE_LOCKED_SHAREDCACHE:
sqlite3_reset(_pStmt);

  •       // fallthrough
    
  •   case SQLITE_BUSY:  
    
  •       if (i < _maxRetryAttempts)
    
  •       {
    
  •           sleep();
    
  •           continue;
    
  •       }
        break;
    default:
        break;
    }
    
  •   break;
    
  •   if ((_nextResponse & SQLITE_BUSY) && (i < _maxRetryAttempts))
    
  •   {
    
  •       sleep();
    
  •   }
    
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions