I have identified two bugs in the DOA source in relation to updating linked TOracleDataSets using standard "nested" clientdatasets in a remote tier. I searched the forum here and did not see either problem previously mentioned.
First bug:
TOracleDataSet does not override and implement the logic for the TDataSet.GetDetailLinkFields() method. This method is (apparently) used to append additional metadata to a provider's outgoing CDS datapacket. The metadata defines the relational linking between master and detail, and is used in the TClientDataSet to propagate the current master record key values to appended detail records automatically. When this method is not implemented, linking metadata is not sent to the TClientDataSet, and it therefore is unable to propagate those keys manually.
The only workaround (short of patching DOA source) is to manually assign the detail record key values in a client-side OnNewRecord event for the detail dataset.
Second bug:
TOracleDataSet.EnableMasterFields() method is marking fields involved in master-detail links as "read-only" at runtime. In the context of a MIDAS remote data module, this is incorrect behavior, as it marks the primary key of the master dataset read-only in the provider metadata sent to TClientDataSet. This causes INSERT operations using TSQLResolver (the default data modification mechanism when using ResolveToDataset=False) to FAIL since the resolver excludes Read-Only fields from INSERT statement generation. There is specific code in this DOA method that causes it to bail out if it determines that it is being run from a TRemoteDataModule. This fixes the problem for projects that directly descend from TRemoteDataModule,... however it does not address the case where a descendant of that class, or more importantly for me, the case where a TMtsDataModule is being used for the same purpose. In this situation, the method will improperly mark master key fields as read-only, which interferes with the later insertion of records using ApplyUpdates.
I am sure I can fix both of these problems by patching my own copy of DOA, however an "official" patch would be more desireable of course. Is there any plans to release a newer version or revision of DOA, and if so - can fixes for these two problems be addressed in such a patch/upgrade?
BTW - we still use Delphi 5 Enterprise here, and no plans to upgrade compiler in near future.
Keith Rome
ZC Sterling, Atlanta
First bug:
TOracleDataSet does not override and implement the logic for the TDataSet.GetDetailLinkFields() method. This method is (apparently) used to append additional metadata to a provider's outgoing CDS datapacket. The metadata defines the relational linking between master and detail, and is used in the TClientDataSet to propagate the current master record key values to appended detail records automatically. When this method is not implemented, linking metadata is not sent to the TClientDataSet, and it therefore is unable to propagate those keys manually.
The only workaround (short of patching DOA source) is to manually assign the detail record key values in a client-side OnNewRecord event for the detail dataset.
Second bug:
TOracleDataSet.EnableMasterFields() method is marking fields involved in master-detail links as "read-only" at runtime. In the context of a MIDAS remote data module, this is incorrect behavior, as it marks the primary key of the master dataset read-only in the provider metadata sent to TClientDataSet. This causes INSERT operations using TSQLResolver (the default data modification mechanism when using ResolveToDataset=False) to FAIL since the resolver excludes Read-Only fields from INSERT statement generation. There is specific code in this DOA method that causes it to bail out if it determines that it is being run from a TRemoteDataModule. This fixes the problem for projects that directly descend from TRemoteDataModule,... however it does not address the case where a descendant of that class, or more importantly for me, the case where a TMtsDataModule is being used for the same purpose. In this situation, the method will improperly mark master key fields as read-only, which interferes with the later insertion of records using ApplyUpdates.
I am sure I can fix both of these problems by patching my own copy of DOA, however an "official" patch would be more desireable of course. Is there any plans to release a newer version or revision of DOA, and if so - can fixes for these two problems be addressed in such a patch/upgrade?
BTW - we still use Delphi 5 Enterprise here, and no plans to upgrade compiler in near future.
Keith Rome
ZC Sterling, Atlanta