Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Persistent classes and 'dirty' data

Former Member
0 Likes
478

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.

1 REPLY 1
Read only

Former Member
0 Likes
430

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.