- This topic has 3 replies, 2 voices, and was last updated 6 years, 6 months ago by .
Viewing 3 reply threads
Viewing 3 reply threads
- You must be logged in to reply to this topic.
Hi,
In my application I use oneway smartbindings to connect two properties which are on separate datamodules. In the target’s property setter method I do, besides setting the value, empty a kbmMemTable and call an on NotifyEvent. There is a datasource component connected to the kbmMemTable and there are some data-aware control connected to the datasource as well.
The problem is that when the setter is called my application gets into a deadlock ☹ When I remove the connection between the datasource and the kbmMemTable it seems to work fine as well.
I have tried to add a critical section in the setter method but without luck. Before I added this design to my main application I wrote a small test application and it works just fine. It’s driving me crazy for a couple of day now. I think I miss something here.
Any suggestion what might cause this problem? I thought that the indirect connections with VCL could cause the problem, but I am not sure about this.
Thanks in advance!
Hi,
Since you (indirectly via the TDataSource and TDataSet event system) trigger VCL components, you must first ensure that you are defining the binding as synchronous. kbmMW can only automatically detect bindings to be synchronous when bound directly to controls.
That will ensure that the VCL controls are not forced to be updated using a different (non GUI) thread.
2ndly, there may (due to the event trains set ablaze in TDataSource and connected controls), be recursive event calls, which could result in the block.
Min tak er stor! Only now do I realize how powerful smartbinding is. It makes life a lot easier.
I’m always happy that the stuff is bringing additional enjoyment to programming 🙂