TOracleDataSet.OnApplyRecord

sparis

Member
I use a TOracleDataSet in a 3-tiers prog. In the server side I use stored proc for updating data in then OnApplyRecord event.
When I found a error, I would like to advise the client side that data was not updated correctly.

I tried to assign False to the Applied parameter and/or raise exception with DatabaseError(...) but it doesn't work.
The client never know that an error occurs.

If there was no error, update works well.

What did I do wrong?

Excuse my english!
 
Are you using a ReconcileErrorForm in your application for this dataset? Without it you will not see any error messages, the ApplyUpdates will simply fail.

Note that you should probably just let an exception propagate to the client, unless you want to provide a specific error message. Setting Applied to False does not help. This merely indicates that you have handled the action in the OnApplyRecord event, so that the dataset knows that it can skip the default apply processing.

------------------
Marco Kalter
Allround Automations
 
Originally posted by mkalter:
Are you using a ReconcileErrorForm in your application for this dataset? Without it you will not see any error messages, the ApplyUpdates will simply fail.

Note that you should probably just let an exception propagate to the client, unless you want to provide a specific error message. Setting Applied to False does not help. This merely indicates that you have handled the action in the OnApplyRecord event, so that the dataset knows that it can skip the default apply processing.

I identify that the problem occurs when the updated field can receives NULL.

If I change a NOT NULL field in the UpdatingTable and I put False in the Applied parameter, the error was created and I can hold her in the OnReconcileError event in the client side.

But if I change NULLable field and I put False in the Applied parameter, no error was created and the UpdatingTable was updated.

It seems to be a bug!?
 
I'm afraid I don't understand the problem. If there is no error, and the table is updated, then what is the problem? Note that the Applied parameter just indicates if the OnApplyRecord event handler has handled the update, it has nothing to do with error handling.

------------------
Marco Kalter
Allround Automations
 
Back
Top