Field not appearing in insert statement

Since our migration to RO 10.0.0.1597 our code is broken

It appears for one table a (primary key) field does not get included in the insert statement.

The pat_primkey field is not included in the insert statement.
The TDABusinessProcessor.CreateMappings does not add the field because aCommand.Params does not contain the field

aCommand.Params.Count=7
while lDeltaFieldList.Count=10

Note: We are using reduceddelta=true (via a modified udabusinessprocessor.pas)

image

What could be the reason of this issue?
How is determined what is in aCommand.Params?

20250203issue.zip (21.8 KB)

Hi,

can you retest this issue with original uDABusinessProcessor.pas, pls ?
ReducedMode should be set on client-side in Bin2DataStreamer and changing it on server-side may cause some problems.

This appears to work.

We have a few (historic) modifications in uDABusinessProcessor.pas

Maybe it is a good time to get rid of them
Here are some questions about that

  1. One is a reference to IDAConnection in the BP



    We use it in the events, e.g.

    If we remove BP.CurrentConnection, how do we typically access the service connection from the BP?

  2. We force enable reducedelta



    I guess we can put DataStreamer.SendReducedDelta:=True; in the constructor of all our classes that derive from TDAMemDataTable. Any idea why we didn’t take this approach in 2010?

  3. We define multiple statements that we then use via the connection name. This allows us to use (highly) different selects with the same DA interface file.


    Is there a way to achieve this without RO code change?

An additional question:

I notice we also set SendReducedDelta property of the ServiceDataStreamer on the server side.

You mention SendReducedDelta should be set at client side
Does this server side code do anything?

Hi,

You can access owner service via BP.Service property. You should cast it to TDataAbstractService however.

We could add Reduced Delta after 2010 …

I can suggest to review code of TDASchema.FindCommandStatement method.
Probably you can find valid condition that will work for you. Also we can make this method virtual so you can override default logic in your TDASchema’s descendant. will it work for you?

Hi,

Setting SendReducedDelta on server-side does nothing when delta is read client-side’s request with delta.

SendReducedDelta has influence to data that is written only.

The BP.Service property approach does not work.

Sender.Service=nil in my AfterProcessChange

weird:

procedure TDataAbstractService.BP_ProcessChanges(aStruct: TDADeltaStruct;
  aChangeTypes: TDAChangeTypes; aSynchronizeAutoIncs: Boolean);
var
  j: Integer;
begin
  if aStruct.BusinessProcessor <> nil then begin
    aStruct.BusinessProcessor.Service := Self;
    try
      aStruct.BusinessProcessor.ProcessDelta(GetConnectionForObject(aStruct.BusinessProcessor.ReferencedDataset), aStruct.Delta, aChangeTypes, aStruct);
    finally
      aStruct.BusinessProcessor.Service := nil;
    end;

update why you can’t use Self ?

We use this mechanism
image

Hi,

You can use BusinessProcessor.Owner inside AfterProcessChange event.