Sqlite database pack with VACUUM

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jota
Posts: 34
Joined: Tue 22 Nov 2011 19:21

Sqlite database pack with VACUUM

Post by jota » Fri 18 May 2012 11:52

Hello.

When i run the statement
ConBDSqlite.ExecSQL('VACUUM',[])
with an active transaction, it return the error
cannot VACUUM from within a transaction.

If before that i run the statement
ConBdSqlite.Commit
it return the error
cannot VACUUM - SQL statements in progress.

What I'm doing wrong.

Thank in advance.

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: Sqlite database pack with VACUUM

Post by ZEuS » Fri 18 May 2012 12:27

Hello.

The problem is due to specificity of SQLite.
To perform the VACUUM command in SQLite you have to finish all active transactions.
Also, the VACUUM command can not be executed when there are opened datasets with the property FetchAll set to False.
You can find more information about the VACUUM command in the official SQLite documentation here: http://www.sqlite.org/lang_vacuum.html

Post Reply