SQLiteSQLite오류 코드
SQLITE_BUSY
busy
다른 표기: 5
어떤 문제인가요?
다른 데이터베이스 연결의 동시 작업 때문에 SQLite 작업을 진행하지 못한 경우입니다.
공식 설명 · 원문
The SQLITE_BUSY result code indicates that the database file could not be written (or in some cases read) because of concurrent activity by some other database connection, usually a database connection in a separate process.
For example, if process A is in the middle of a large write transaction and at the same time process B attempts to start a new write transaction, process B will get back an SQLITE_BUSY result because SQLite only supports one writer at a time. Process B will need to wait for process A to finish its transaction before starting a new transaction. The sqlite3_busy_timeout() and sqlite3_busy_handler() interfaces and the busy_timeout pragma are available to process B to help it deal with SQLITE_BUSY errors.
An SQLITE_BUSY error can occur at any point in a transaction: when the transaction is first started, during any write or update operations, or when the transaction commits. To avoid encountering SQLITE_BUSY errors in the middle of a transaction, the application can use BEGIN IMMEDIATE instead of just BEGIN to start a transaction. The BEGIN IMMEDIATE command might itself return SQLITE_BUSY, but if it succeeds, then SQLite guarantees that no subsequent operations on the same database through the next COMMIT will return SQLITE_BUSY.
See also: SQLITE_BUSY_RECOVERY and SQLITE_BUSY_SNAPSHOT.
The SQLITE_BUSY result code differs from SQLITE_LOCKED in that SQLITE_BUSY indicates a conflict with a separate database connection, probably in a separate process, whereas SQLITE_LOCKED indicates a conflict within the same database connection (or sometimes a database connection with a shared cache).
해결·진단 링크
문서의 제품·버전·발생 환경이 현재 상황과 일치하는지 먼저 확인하세요.
- 일반 진단 가이드
잠금 대기 시간과 busy handler 확인 ↗
해당 코드 · 적용 환경 확인
- 코드 참고
공식 결과 코드 의미와 처리 설명 ↗
정의·설명 · 해결 절차 아님
출처·이용 조건
저작자: SQLite authors / Hwaci
라이선스: Public domain dedication (SQLite code and documentation)
확인일: 2026-11-12
변경 내역: English prose extracted; whitespace normalized; Korean context and classified official links added. Python code examples not redistributed.