2011-09-02 5 views

답변

0

"데이터베이스 잠김"은 데이터베이스가 잠겨 있음을 의미합니다. 데이터베이스에 대한 다른 sqlite 작업은 여전히 ​​"보류"상태입니다. 아마도 이전 쿼리를 완료하지 못했거나 비동기 스레드에서 계속 쿼리가 발생했기 때문일 수 있습니다.

4

저는 SQLite 인터페이스에서 기존의 cruft를 사용하고 있다고 생각합니다. 요약하면 sqlite3_step이고 결과가 오류이면 slite3_finalize은 같은 오류를 반환합니다. sqlite3_step과 다른 SQLite 호출에 대한 오류에주의하고 slite3_finalize에서 오류를 무시하십시오. sqlite3_finalize에 대한 SQLite는 문서 당

:

그것은 문 보다는 마무리 자체의 가장 최근의 평가에 대해 이야기

If the most recent evaluation of the statement encountered no errors or or if the statement is never been evaluated, then sqlite3_finalize() returns SQLITE_OK . If the most recent evaluation of statement S failed, then sqlite3_finalize(S) returns the appropriate error code or extended error code.

. 이것은 충분히 명시 근처에 아무데도되지만 문서의 다른 의견이 : 그것은이는 V2 API에 의해 고정되어 말을 계속

Goofy Interface Alert: In the legacy interface, the sqlite3_step() API always returns a generic error code, SQLITE_ERROR , following any error other than SQLITE_BUSY and SQLITE_MISUSE . You must call sqlite3_reset() or sqlite3_finalize() in order to find one of the specific error codes that better describes the error.

,하지만 난 그 부분적으로 만 올바른 생각합니다. v2 API를 사용할 때 sqlite3_step은 오류 코드를 직접 반환합니다. 그러나 sqlite3_finalize_v2은 없습니다. 그리고 내 테스트에서 sqlite3_finalizesqlite3_step에서 오류 코드를 계속 반환합니다.

즉 : sqlite3_finalize에서 오류를 무시하십시오. 거의 확실하게 받고있는 오류에주의하고 sqlite3_step을 무시하십시오.

+0

이 요약은 허용 된 답변보다 * 많은 * 도움이됩니다. 건배, 스티븐! – Magnus