UseMessageTable and CachedUpdates

billm

Member
I'm having difficulty with UseMessageTable when CachedUpdates is True on a TOracleDataSet.

With multiple datasets on a form, some are single row edits, some are grid based edits. I need the CachedUpdates as the contents can be invalid during editing. This works fine, no problems.

However, the MessageTable is not being using when I call Session.ApplyUpdates([...]).

If I set the DataSet.EnforceConstraints or the DataSet.OracleDictionary.EnforceConstraints to True, then it does use the MessageTable correctly but does not obey the cached updates :-( The messages are popping up left right and centre as the various grids etc are edited. I need these purely when the ApplyUpdates is called - not during the editing.

Am I being thick and missed something or is this behaviour not supported?

Thanks
Bill
 
The EnforceConstraints property causes immediate validation of posted records. In your scenario it should be disabled.

If you just want to translate messages through a MessageTable when records are applied to the database, set TOracleDataSet.OracleDictionary.UseMessageTable and TOracleSession.MessageTable.
 
Thanks for the prompt reply, my datasets and session are configured exactly as you describe but I'm not getting translated messages.

I've just created a small demo project exactly the same and would you believe it works fine, I even copied the datasets and session from the problematic project and they also work in the demo project but not in my original project.

I'll keep looking to find out what's happened and let you know.
 
Hi Marco,

I found the problem - the constraint was set as deferred (in my test project a different, immediate constraint was being violated hence it worked in there).

I guess the message translation is only being applied on Session.ApplyUpdates and not on Session.Commit;

Many Thanks
Bill
 
Bill,
Thanks for usefull info. I also use defferred constraints a lot.

Marco,
Will the message table be used for constraints on commit level? That would be handy.

Regards,
Alex
 
We'll make the message translation available in 4.0. Right now it is defined at the TOracleDataSet level, and it's private, both of which need to be changed if you want to translate a message during a commit.

------------------
Marco Kalter
Allround Automations
 
Hm, TOracleDataSet::TranslatedMessage is still private in 4.0.4.0...

btw: I would prefer to have this function separatly from TOracleDataSet, maybe in TOracleSession.
 
Back
Top