` Comment on an Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Add a comment to an Icetips Article

Please add your comments to this article. Please note that you must provide both a name and a valid email address in order for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!

Your Name:  
Email:  
Header text/Subject:  

Please enter your comment in the box below:

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Par2: Clarion Threads: Relation manager
2002-12-29 -- Owen Brunker
 
I've made all the necessary modifications to the ABC classes to test my idea and so far so good. One interesting discovery though is the fact that the Relation Manager object is not thread safe. Relation Manager uses a queue of references to manage relationship links between other Relation manager objects. Each queue record also contains a reference to an instance of the buffered fields class to manage the fields used to form the relationship link. It is the implementation of the buffered fields class that is not thread safe. At the heart of the BufferedFieldClass is a queue containing three fields. BufferedPairsQueue.Left, BufferedPairsQueue.Right and BufferedPairsQueue.Buffer. It is field BufferedPairsQueue.Buffer that is the problem. When a record update form is called, the Window Manager class calls RelationManager.Save from its PrimeUpdate method. RelationManager.Save loops through the Relation manager's queue of relationship links and calls the queue record's instance of BufferedPairsClass.AssignLeftToBuffer causing the current file record's link fields to be saved. If a second instance of the record update form is opened on another thread, the saved link fields for the previous thread is over written. When you go back to the first instance of the record update form, change the contents of one field and then save the record, you will witness all the child records having the cascade on update attribute will attach themselves to the record contained in the second instance of the record update form. I am currently looking at making the RelationManager's implementation of the BufferedPairsClass thread safe so I dont have this problem.


Today is November 21, 2024, 6:41 am
This article has been viewed 35229 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: