BDE vs ADO in Delphi

后端 未结 3 1714
一向
一向 2020-12-13 21:50

Please note the Edit below for a lot more information, and a possible solution

We recently modified a large Delphi application to use ADO connection

3条回答
  •  渐次进展
    2020-12-13 22:17

    I don't know about Delphi 2007, but I did same thing with Delphi 7 and Oracle 8.

    Here are things I did:

    • Set TAdoDataSet.CursorLocation according to query:
      • clUseClient if query fetches records for GUI and query is relatively "simple" - no grouping or sum
      • clUseServer if query have some sort of aggregation (sum, grouping, counting)
    • Set TAdoDataSet.CursorType according to query:
      • ctForwardOnly for reports where you don't need scroll back through dataset - works only with clUseServer
      • ctStatic for GUI. This is only mode that works with clUseClient
    • Set TAdoDataSet.LockType according to query:
      • ltReadOnly for every dataset that is not used for editing (grids, reports)
      • ltOptimistic when records are posted to database immediately after change (e.g. user editing data on form)
      • ltBatchOptimistic when you change large number of records. This is for situations where you fetch number of records, then do some processing on them and then send updates to database in batch. This works best combined with clUseClient and ctStatic.
    • In my experience, Microsoft OLEDB provider for Oracle worked better than Oracle OleDb provider. You should test that.
      Edit: Check Fabricio's comment about possible blob problems.
    • Replace TAdoQUery with TAdoDataSet. TAdoQuery was created for conversion of apps from BDE to ADO, but Borland/Codegear recomendation was to use TAdoDataSet
    • Recheck Oracle connection string to be sure that you do not have network latency. How long it lasts to connect to Oracle? How long is TnsPing?

提交回复
热议问题