Subject Re: Deploying FireBird (FDB files) in a client machine
Author Adam
--- In, "jb_warrier80"
<jb_warrier80@y...> wrote:
> Hello there
> I am fairly new to this support group. I recently downloaded the
> firebird database and am working with it. I am developing a small
> billing application with dotnet 1.1 with firebird. I did a small test
> with connection and all it works really good. I have a question though
> 1. When deploying this application, can i just do a xcopy deployment
> of fdb files and make it work ??, just like we do a in ms access.

The Firebird DBMS comes in 3 types, Superserver, Classic and Embedded.
The first two types run as a service, and allow multiple client
machines to connect to the database. Embedded is a cut down version of
Superserver that launches within a DLL. Only one application can
connect to the database at a time using this model, and the connection
must be local.

Superserver and Classic can be installed either using the installer or
by using the zip archive. Embedded comes in the form of a zip archive,
basically copy your application into the base directory and rename the
dll to fbclient.dll or gds32.dll depending on your connection components.

A fdb file is just a file like a word document but there is a caveat.
The database engine manipulates small parts of the file called pages.
If you take a file system copy of the database while the server is
running, then the information in the database header (what
transactions are committed etc) may be out of date when the page
itself containing the changes is copied. This will obviously leave you
with a corrupt database. Some people have even reported the original
database you are copying from corrupting. I personally can't see how
this would happen and more than say using gstat, but given that the
destination is going to be corrupt if anything is done by the engine
between the start and end of the copy process, there is no point in
making a copy in this way. Once the service is shutdown (Superserver
or Classic) or the application is closed (Embedded), it is safe to
file system copy. Keep in mind that it may take a few seconds to
finish off its actions before you can copy, rename the file to see
when the lock is released. I imagine actually that ms-access would
have the same issues.

Also be aware that Firebird pads the fdb file. Unless it is restored
with the use 100% of the space option, it anticipates that you are
going to want to make changes, and that because it has better
performance when record versions are on the same page, holes are left.
This means that the fdb file will be significantly larger than it
needs to be inside your installer. You can use the gbak tool to create
a backup file and this will compress much smaller. You can restore the
database when installing.

There are some endian issues when copying a fdb file, but as long as
you are using some breed of windows it is not an issue.