Subject AW: [firebird-php] Database corruption
Author Wolfgang Naber
Thank you Lester and Barry for your reply.

Lester wrote:
>BDE is not very good at client/server multi-user access. It
>is probably causing the problem, and is most definitely not
>recommended for working with Firebird.

I do know. Unfortunately the cs-application is not written by myself.

Barry wrote:
>Make sure that the connection strings for all the applications are the
>same. And don't use a direct connection. Always go through TCP/IP, eg:
>localhost:/usr/local/fbk/wawi.gdb
>
>or
>
>www:/usr/local/fbk/wawi.gdb

I got the parameters for the bde-component from the developer of the client-server application.
DB.Params.Clear;
DB.DriverName := 'INTRBASE';
DB.Params.Values['BATCH COUNT'] := '200';
DB.Params.Values['BLOB SIZE'] := '32';
DB.Params.Values['BLOBS TO CHACHE'] := '64';
DB.Params.Values['COMMIT RETRAIN'] := 'FALSE';
DB.Params.Values['ENABLE BCD'] := 'FALSE';
DB.Params.Values['ENABLE SCHEMA CACHE'] := 'FALSE';
DB.Params.Values['LANGDRIVER'] := 'DBWINUS0';
DB.Params.Values['MAX ROWS'] := '-1';
DB.Params.Values['OPEN MODE'] := 'READ/WRITE';
DB.Params.Values['SCHEMA CACHE SIZE'] := '8';
DB.Params.Values['SCHEMA CACHE TIME'] := '-1';
DB.Params.Values['SERVER NAME'] := ServerPfad;
DB.Params.Values['SQLPASSTHRU MODE'] := 'SHARED AUTOCOMMIT';
DB.Params.Values['USER NAME'] := User;
DB.Params.Values['WAIT ON LOCKS'] := 'FALSE';
DB.Params.Values['PASSWORD'] := Password;
DB.Params.Values['DRIVER FLAGS'] := '4096';
DB.LoginPrompt := False;
...

IB.Params.Clear;
IB.Params.Values['USER_NAME'] := User;
IB.Params.Values['PASSWORD'] := Password;
IB.Params.Values['LC_CTYPE'] := 'WIN1252';
IB.LoginPrompt := False;
IB.DataBaseName := ServerPfad;

And this is my connection string:

$conn = &ADONewConnection('ibase');
$conn->charSet = 'WIN1252';
$conn->buffers = 2048;
$conn->dialect = 1;
$db_server = 'localhost:/usr/local/fbk/wawi.gdb';
$db_user = 'xyz';
$db_pass = 'xyz';
$db_database = '/usr/local/fbk/wawi.gdb';
$conn->Connect($db_server, $db_user, $db_pass);

A db-tool showed me the value for buffers (Pages=2048 KB=8192). Hopefully I took the right value.
In my opinion this connection string should be correct?!?

Maybe transaction management is responsible for this issue. Yesterday i read the articel "Optimization I: Optimizing InterBase Applications" in which Craig Stuntz wrote "One important consequence of the principle of isolation is that every client running a SELECT statement must start ist, fetch, rows, and terminate the statement within the context of a single transaction".

How is this achieved in a php-application? Until now i thought that this is handled automatically by the php interbase-interface. Is this correct?

Wolfgang