wcdb icon indicating copy to clipboard operation
wcdb copied to clipboard

Database close

Open 0x1306a94 opened this issue 2 years ago • 1 comments

The language of WCDB

C++

The version of WCDB

v2.0.4

The platform of WCDB

macOS

The installation of WCDB

Git clone

What's the issue?

  • Create Database and configure traceSQL callback. Then after performing certain operations, manually call close to close the Database. and release the Database object. After calling close for a period of time, it is observed that the callback of traceSQL is executed again, and the following SQL is output.
PRAGMA journal_mode
PRAGMA checkpoint_fullfsync = TRUE
PRAGMA temp_store = 1
PRAGMA journal_mode
PRAGMA checkpoint_fullfsync = TRUE
PRAGMA temp_store = 1
  • Through breakpoint debugging, it was found that it was triggered by doCheckpoint in OperationQueue.
  • Under normal circumstances, after calling close, you should no longer operate the corresponding database, right?

0x1306a94 avatar Dec 06 '23 01:12 0x1306a94

Indeed, it can be improved.

Qiuwen-chen avatar Dec 07 '23 15:12 Qiuwen-chen

Fixed in v2.1.0.

Qiuwen-chen avatar Mar 08 '24 02:03 Qiuwen-chen