Convert Standalone Delphi/Dbase IV to Network version
Posted on 2008-06-16
The task is to convert a Delphi (version 5) Dbase IV Standalone application to Client Server without spending a single penny for the conversion. The Delphi application uses BDE, TTable and TQuery. TTable is used extensively to navigate, edit data and also to handle indexes(AddIndex, DeleteIndex).
1. Put the database (DBF and MDX files) in a shared directory in the system meant as Server
2. Install BDE in all the client systems and point the Alias path to the shared directory on Server. Also we have to configure the BDE (things like Local Share = true, use same IDAPI32 and so on..)
This should make the application client-server type.
Following issues have to be considered:
1. How to handle the table/row locking in a Multiuser environment in a smooth manner?
2. The current code applies a Exclusive table lock before Deleting/Adding Indexes?
To handle the locking problems, I have thought of using the CLientDateSet-Provider combination (along with the famous reconcile error dialog) for each TTable and TQuery.
But, the real problems are creeping up only when I try to use the CLientDataSet instead of TTable.
For example the tTable.AddIndex/DeleteIndex - will it work from a ClientDataSet ?
Is it not related to the physical DBF file?
Is the Add/Delete index really requried since a single MDX file can hold a lot of indexes?
Is the Exclusive lock in this case really neccesary (it seems so)?
If we leave the tTable as it is for handling Index alone, what will happen when a Exclusive lock is applied for adding/deleting indexes in a multiuser environment?
Actullay, I did consider using CachedUpdates first. But, the help itself seems to recommend the CLientdataset-provider model. Should I retrace my steps and settle for CachedUpdates instead of Clientdataset? (Then I hope I do not have to bother about index handling code. But, I will have to forget the beautiful reconcile dialog (: in the bargain)
I have all these troubling questions and I am lost.
Any help and guidance is most welcome....(and I am running of time)