Autosaving stacks corrupted on network drives

Mike Kerner MikeKerner at roadrunner.com
Wed Oct 25 12:26:00 EDT 2017


Now if what you're suggesting is that the server OS should manage the
access process so that you cannot have two simultaneous accesses, I would
agree, but my experience has been that it doesn't always work that way.

On Wed, Oct 25, 2017 at 12:19 PM, Mike Kerner <MikeKerner at roadrunner.com>
wrote:

> I'm saying that it is possible to access the same file from the same share
> from multiple machines and leave the file in an indeterminate or corrupted
> state, afterwards, especially if both machines accessing the share are
> trying to save changes to said file.  The purpose of the semaphore would be
> to stop the simultaneous access of the file from multiple machines.
>
>
> On Wed, Oct 25, 2017 at 11:54 AM, Bob Sneidar via use-livecode <
> use-livecode at lists.runrev.com> wrote:
>
>> I thought the OS takes care of that. Are we saying that when saving to a
>> network share this process of creating the semaphore file does not happen?
>>
>> Bob S
>>
>>
>> > On Oct 24, 2017, at 16:01 , Mike Kerner via use-livecode <
>> use-livecode at lists.runrev.com> wrote:
>> >
>> > Possible solutions:
>> > 1) Do what LibreOffice does.  Create an invisible semaphore file that
>> the
>> > stack checks for on open.  If it exists, the open is rejected and the
>> stack
>> > immediately closes.  This will keep secondary and simultaneous users
>> from
>> > getting their grubby paws into the stack before the save/sync is
>> complete.
>> > As part of this solution, I would suggest any quit/closeStack event has
>> a
>> > built in delay to confirm that the sync/save has completed before
>> removing
>> > the semaphore.  This is still tricky as you are at the mercy of the
>> > sync/save tool, however, if you're clever, you can use the service's
>> api to
>> > check, separately, if the sync/save is complete before you let LC finish
>> > closing down.
>> > 2) Split the data out into a separate data file or better into a
>> database
>> > (because most databases use transactions, with greatly minimizes the
>> > probability of corruption).
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
>
> --
> On the first day, God created the heavens and the Earth
> On the second day, God created the oceans.
> On the third day, God put the animals on hold for a few hours,
>    and did a little diving.
> And God said, "This is good."
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."



More information about the use-livecode mailing list