Checking to see if Valentina database is open RunRev

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Sep 12 15:31:47 EDT 2008


On 9/12/08 10:10 PM, "william humphrey" <shoreagent at gmail.com> wrote:

Hi William,
Hi JB,

1) we have function VDatabase_IsOpen()

2) your main trouble is from misunderstanding of one important point.

    ** Valentina db DO NOT provide SHARED ACCESS to disk files.
        So this is wrong task: how I can get info if db is opened by
        another application. Db must be opened in EXCLUSIVE mode.
        So if app1 have open db then app2 just must not be able open it.
    
    ** we have relaxed this requirement to allow open db for second app
        in READ ONLY mode.

    ** we allow set flag Read Only on db disk files, then every app will
        open it in READ ONLY mode.

And you have trouble on OS X only because OS X itself do not provide
exclusive mode like Linux.

Official solution is:
    set of applications which can open some file agree to use
    special db_name.lock file as indicator that file is opened.

You can implement this in your app also btw, but I know you worry about
Valentina Studio.

Conclusion: 
    * we need add this behavior to Vstudio also.
    * or may be even better into engine itself. So it will work always.

I have see that for example Archicad do this lock file even on Windows.
Probably they was lazy to disable this code for win.


We did not implement this feature so far mainly because nobody have consider
it as show stopper.

Also this behavior bring new trouble:
    if app finish not normally then lock file is left...
    so nobody can open db until this file will be trashed manaully
    or some use 15 min timeout
    or Archicad offers button  "Open Exclusive"
    

So this lock file solved one problem, but bring more.

And I still not sure we need add this inside of db engine.
You can always add this technique into your REV app if you want.


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]





More information about the use-livecode mailing list