Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can this approach corrupt table?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01553564
Message ID:
01553711
Views:
51
I hope I'm not leading you down the wrong trail and that could be the case as your situation is somewhat unique and I can't say that I even fully understand it.

My understanding of SYS(3052) for CDX and MEMO helps prevent corruption by ensuring that the process gets a lock on the CDX and the MEMO files before any updating takes place. Corruption can occur when the data gets updated, but for some reason the CDX could not get updated because another user beat your process to the lock and made the change first or your process was unable to make the change at all.

It's really a mystery to me even though I worked in the VFP group at Microsoft. I was told that this would help prevent corruption and I've just used it ever since. And, I have not had any corruption ever except when we had our data on Novell servers and they were having problems.

>I did read the FoxPro Help and saw that SET REPROCESS was mentioned. But, honestly, it didn't connect in my mind.
>And I have not changed the code in my program. What I would like to do is to understand the SET REPROCESS and the SYS(3052) better to see if this is what I need to prevent data corruption. I wish I could create a sample/test code and corrupt a table at will. Then see how the SYS(3052) would solve the corruption. Maybe I have not taken enough time - yet - to understand this.
>Thank you for clarification.
>
>
>>Dmitry,
>>
>>I failed (I am sorry) to mention that these sys functions work in conjunction with SET REPROCESS. See the very confusing FoxPro Help on this command.
>>
>>The default is 0, which means wait indefinitely for the locks to happen.
>>
>>>Thank you very much for your help!
>>>
>>>>It's a little strange:
>>>>
>>>>sys(3052,1,.t.)
>>>>sys(3052,2,.t.)
>>>>
>>>>
>>>>>How do you set the SYS(3052),1) to TRUE? I tried the following:
>>>>>
>>>>>SYS(3052,1) = .T.
>>>>>
>>>>>but I get syntax error. What am I missing? Thank you.
>>>>>
>>>>>>This may be way off the mark, but is a BEST PRACTICE for multiuser applications.
>>>>>>
>>>>>>What are your settings for the following SYS commands?
>>>>>>
>>>>>>SYS(3052,1)
>>>>>>SYS(3052,2)
>>>>>>
>>>>>>The FoxPro defaults are not exactly wrong, but are "backward compatible" and useless.
>>>>>>
>>>>>>These should both be set to TRUE in any multiuser application.
>>>>>>
>>>>>>See the following in VFP Help:
>>>>>>
>>>>>>SYS(3052) - Override SET REPROCESS Locking
>>>>>>
>>>>>>
>>>>>>>Hi,
>>>>>>>
>>>>>>>Lately a few customers reported to me table corruption with one specific table. Which made me think of possibly flawed design I implemented. Here is the description of the design - in general terms.
>>>>>>>
>>>>>>>I have a BIZ base class that is used for pretty much all tables of the application. For example, a form can instantiate any number of the BIZ classes based on this class, depending on the tables used (e.g. Vendors, Staff, Parts, etc.). In the INIT method of the base BIZ class a BIZ class to an audit table is instantiated (using the same base class). Therefore, each BIZ class has a reference (class property) to a BIZ class of this audit table. All BIZ classes use CursorAdapter to connect to the base tables. And therefore at any given time there could be a number of BIZ classes "pointing" to the same physical table (audit table). This audit table is the one that gets corrupted. Could this approach cause the corruption? I am thinking of redesigning the base BIZ class and NOT to instantiate the Audit Table BIZ class but rather do just one BIZ class for the entire data session. But before I go through tons of work of rewriting this, I would like to hear your input.
>>>>>>>
>>>>>>>TIA.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform