Board index » delphi » Problem with BDE settings / Paradox tables

Problem with BDE settings / Paradox tables

I have written a delphi 4 application using DCOM and midas (connect type =
socket). All seems to work fine. The Database is Paradox. The server is an
NT4 Server (Service Pack 4).  RAM size is 256 Mo. there are enough free disk
space.

But I periodically got some problems with the datas.
3 kinds of problem :

1) Index corruptions (fixed by Tutil32).
2) header of a table corruptions (fixed by Tutil32).
3) Data lost ! (sometimes the last new recors added during the session are
lost). (not fixed at this time).

The problem occurs nearly every times on the same table. It is the biggest
table of the database. It has up to 600 000 records. record size=324. the
table has 10 indexes (Primary and secondary). in all the database the table
level is 7 and the block size=32. Theses two parameters have been set in the
BDE configuration as well.

The accesses to the tables in the application  are realised by the COM
servers written in Delphi 4C/S (update pack #3). There are classicals COM
servers written with a remote data module in which I use some Ttables and
TQuery components. Some of them are exported in the Type Library in order to
be connected to ClientDataSet, some other no.
No other applications access the tables.

thread cache size in the scktsrvr.exe =100.

BDE version =5.1 (idapi32.dll =5.1.1.1)

Parameters of the BDE :

PARADOX :
 VERSION  : 4.0
 TYPE :   FILE
 LANGDRIVER:  Pdox ANSI Intl
 NET DIR : C:\NETDIR
 BLOCK SIZE 32768
 FILL FACTOR 95
 LEVEL  7
 STRICTINTEGRITY FALSE

SYSTEM/INIT
 AUTO ODBC  FALSE
 DATA REPOSITARY
 DEFAULT DRIVER PARADOX
 LANGDRIVER  Pdox ANSI Intl
 LOCAL SHARE  TRUE
 LOW MEMORY USAGE LIMIT 32
 MAXBUFSIZE  128
 MAXFILEHANDLES 48
 MEMSIZE  64
 MINBUFSIZE  128
 MTS POOLING  FALSE
 SHAREDMEMLOCATION
 SHAREDMEMSIZE 8192
 SQLQRYMODE  0
 VERSION  4.0

Are theses parameters corrects ?
Can someone help me with my data corruption problem.

Thanks a lot in advance..

 

Re:Problem with BDE settings / Paradox tables


Yves,

Index out of date happens when the application updates the .db table but
doesn't get the opportunity to completely update each and every index.
The more indexes the greater the risk.

Having said that you can take some steps to reduce risk. This includes but
is not limited to the following:

1) increase your file handles - large tables may end up using many temp
tables
    We typically set file handles to 256.
2) perform a table.flushBuffers on before close. This is because of how the
    windows caching system works.
3) close tables when they are not in use. This will reduce partially flushed
table
    issues.
4) Always open and close tables programaticly. Never leave tables open in
    the IDE.
5) Avoid autoincrement primary keys.
6) Avoid .val files (referential integrity and default values) especially on
large
     tables
7) Attempt to create simple primary keys - This will help in two ways. It
will
    reduce the size of secondary indexes (primary key values are stored for
    maintained secondary indexes) and if primary keys are system assigned
    integer values then records do not move from page to page during edits
    which greatly reduces the amount of time to post edits. Finally system
    assigned primary keys usually increment meaning that new recordss are
    always appended to the end of the table rather than forcing pages
    to split in order to maintain primary key order.

Garry Kernan

| I have written a delphi 4 application using DCOM and midas (connect type =
| socket). All seems to work fine. The Database is Paradox. The server is an
| NT4 Server (Service Pack 4).  RAM size is 256 Mo. there are enough free
disk
| space.
|
|
| But I periodically got some problems with the datas.
| 3 kinds of problem :
|
| 1) Index corruptions (fixed by Tutil32).
| 2) header of a table corruptions (fixed by Tutil32).
| 3) Data lost ! (sometimes the last new recors added during the session are
| lost). (not fixed at this time).
|
| The problem occurs nearly every times on the same table. It is the biggest
| table of the database. It has up to 600 000 records. record size=324. the
| table has 10 indexes (Primary and secondary). in all the database the
table
| level is 7 and the block size=32. Theses two parameters have been set in
the
| BDE configuration as well.
|
| The accesses to the tables in the application  are realised by the COM
| servers written in Delphi 4C/S (update pack #3). There are classicals COM
| servers written with a remote data module in which I use some Ttables and
| TQuery components. Some of them are exported in the Type Library in order
to
| be connected to ClientDataSet, some other no.
| No other applications access the tables.
|
| thread cache size in the scktsrvr.exe =100.
|
| BDE version =5.1 (idapi32.dll =5.1.1.1)
|
|
| Parameters of the BDE :
|
|
| PARADOX :
|  VERSION  : 4.0
|  TYPE :   FILE
|  LANGDRIVER:  Pdox ANSI Intl
|  NET DIR : C:\NETDIR
|  BLOCK SIZE 32768
|  FILL FACTOR 95
|  LEVEL  7
|  STRICTINTEGRITY FALSE
|
| SYSTEM/INIT
|  AUTO ODBC  FALSE
|  DATA REPOSITARY
|  DEFAULT DRIVER PARADOX
|  LANGDRIVER  Pdox ANSI Intl
|  LOCAL SHARE  TRUE
|  LOW MEMORY USAGE LIMIT 32
|  MAXBUFSIZE  128
|  MAXFILEHANDLES 48
|  MEMSIZE  64
|  MINBUFSIZE  128
|  MTS POOLING  FALSE
|  SHAREDMEMLOCATION
|  SHAREDMEMSIZE 8192
|  SQLQRYMODE  0
|  VERSION  4.0

Other Threads