Web-based Application in Revolution

Ruslan Zasukhin sunshine at public.kherson.ua
Sun Oct 7 16:26:38 EDT 2007

On 7/10/07 11:07 PM, "Andre Garzia" <andre at andregarzia.com> wrote:

Hi Andre,

> usually when building Revolution web aps, people use apache cgi interface,
> so for each web request, apache will launch an instance of the revolution
> engine. If you have two concurrent requests, you will have two instances
> running. Each with their own V4REV external loaded. What happens if they
> both try to access the same Valentina database.
> SQLite have built in methods for locking the file if they are opened by more
> than one application at the same time, so all transactions are atomic. You
> still have the problem of one instance overwritting the changes of the other
> instances, but you can guarantee that both accessess will happen and will go
> thru without file corruption.
> What I am to say is that using SQLite you can build a minimal web
> application if you're clever enough to build a locking mechanism to prevent
> overwritting other users changes. My SQLite will guarantee the transactions
> or in other words, the multiple client access to the file.
> Now, since I really like Valentina, can we do something similar with V4REV,
> can more than one application access the same database file without using
> Valentina Server?

Short answer: YES.

Long Answer:

* History:

    MAC OS 9 - did have exclusive open for files
    Windows also did have it and DO have it.
    OS X like linux - do not have it.

* Unix world and APPLE on its site recommend "fight" with this using LOCK
FILE. For example, When app opens a Valentina db, you check if exists in the
same disk location dbname.lock file. If not exists - you make it and open
db. So other user will see file and will wait until it go away.

Yes more headache for developers thanks to *nix way.
How hard make it for you in REV?  5-6 lines of code?

* Should I explain how much better to use VSERVER instead of such way? :-)
    I sure you understand that loading of V4REV or SqlLite plugin
    in each Apache copy means init/kill each time cache.
    Working with Valentina Server cache not dies.
    Also time on open/close of db file.

Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information

[I feel the need: the need for speed]

More information about the Use-livecode mailing list