[yunqa.de] Re: New feature (DISQLite3 2.3.0)

  • From: Delphi Inspiration <delphi@xxxxxxxx>
  • To: yunqa@xxxxxxxxxxxxx
  • Date: Tue, 03 Aug 2010 10:42:14 +0200

On 03.08.2010 06:35, Gregory Whitesides wrote:

>> The logical database size is now stored in the database header so 
>> that bytes can be appended to the end of the database file without 
>> corrupting it.

CAUTION: Any data appended to the end of the database file beyond the
locigcal database size may be overwritten when the database grows as a
result of inserting or updating records.

> Could you please provide any example how to use it for storing 
> additional user data (DB description, etc.)?

No. The "logical database size is now stored in the database header" is
not a feature intended to allow appending extra application data to the
database. It should not be (ab)used by applications.

Instead, it serves two purposes:

1. As a security measure to protect the database in case exra bytes
are accidentially left appended at the end of the database, i.e. if a
limited or faulty disk driver fails to shrink the database file size.

2. It allows database space to be preallocated. This can be used to
reduce file-system fragmentation. There is no interface for this yet,
but will most likely be added to in the next version.

Ralf
_______________________________________________
Delphi Inspiration mailing list
yunqa@xxxxxxxxxxxxx
//www.freelists.org/list/yunqa



Other related posts: