Enable Or Disable Extension Loading(SQLITE)
분류없음 2008/10/14 13:31Interrupt A Long-Running Query
- 장시간 구동 쿼리 중지
void sqlite3_interrupt(sqlite3*);
This function causes any pending database operation to abort and return at its earliest opportunity.
- 이 함수는 길어지는 database 작업을 중단시켜서 빠른시간안에 다른 작업을 수행할 준비를 할수 있게 해준다.
This routine is typically called in response to a user action such as pressing "Cancel" or Ctrl-C where the user wants a long query operation to halt immediately.
- 이 함수의 역할은 긴 시간이 걸리는 작업에 대해서 "Cancel" 하거나 Ctrl-C 를 통하여 작업 중지 하는 것과 같은 역할을 한다.
It is safe to call this routine from a thread different from the thread that is currently running the database operation.
- 이 함수의 사용은 현재 실행중인 다중 쓰레드의 동시 작업 들에 대해서 안전하다.
But it is not safe to call this routine with a database connection that is closed or might close before sqlite3_interrupt() returns.
- 하지만 sqlite3_interrupt() 가 끝나기 전에 중지된 혹은 중지될 database connection 에 대해서는 안전 하지 않다.
If an SQL operation is very nearly finished at the time when sqlite3_interrupt() is called, then it might not have an opportunity to be interrupted and might continue to completion.
- 만일 sqlite3_interrupt() 가 호출되는 순간 바로 끝나버릴 SQL 작업이있다면 작업의 온전한 중지를 하지 못한다.
An SQL operation that is interrupted will return SQLITE_INTERRUPT.
- 중지된 SQL operation 에 대해서는 SQLITE_INTERRUPT 를 반환한다.
If the interrupted SQL operation is an INSERT, UPDATE, or DELETE that is inside an explicit transaction, then the entire transaction will be rolled back automatically.
- 만일 INSERT,UPDATE,DELETE 명령어 수행중 중지 되었다면 전체 transaction이 자동적으로 Roll back 된다.
A call to sqlite3_interrupt() has no effect on SQL statements that are started after sqlite3_interrupt() returns.
- 시작된후 sqlite3_interrupt() returns 을 받은 SQL 문에 대해서는 sqlite3_interrupt() 함수를 (다시) 호출해도 아무런 영향이 없다.
Invariants:
H12271 The sqlite3_interrupt() interface will force all running SQL statements associated with the same database connection to halt after processing at most one additional row of data.
H12272 Any SQL statement that is interrupted by sqlite3_interrupt() will return SQLITE_INTERRUPT.
Assumptions:
A12279 If the database connection closes while sqlite3_interrupt() is running then bad things will likely happen.
See also lists of Objects, Constants, and Functions.
Trackback Address :: http://www.microstrong.pe.kr/tt/trackback/24

