‎2004 Oct 22 8:50 AM
Hi all,
I am looking into using a persistent class for the records of a database table.
I have been experimenting with it, but I don't know how best to handle 'dirty' data that may be contained in the instance.
The scenario I have is as follows:
Two seperate programs get instances of the same persistent object with the same key. On checking the status of these instances, they both are status 2. I then use a set method on both instances, which both return 0 in sy-subrc. On checking again the status of these instances, the instance that set first has a status of 3 (changed) and the second has a status of 2 (unchanged).
Then both classes commit work and wait, both return 0 in sy-subrc.
My problem is that I cannot tell if the second class has either not used any set methods (so is unchanged) or it is using 'dirty' data, so will not change the data.
Is there something that I am missing on this?
many thanks,
Alex.
‎2004 Oct 22 9:22 AM
I think I may have now found the answer.
I believe that it is just a case of using Locks as usual on the data, so that the second program cannot gain the lock until the first has finished.
If anybody has anything better please let me know.
thanks,
Alex.