From jan@swi.swi.psy.uva.nl Mon Dec  3 22:38:43 2001
Received: from gollem.swi.psy.uva.nl (gollem.swi.psy.uva.nl [145.18.152.30])
	by swi.psy.uva.nl (8.10.2+Sun/8.11.2) with ESMTP id fB3Lchk19091;
	Mon, 3 Dec 2001 22:38:43 +0100 (MET)
Received: (from jan@localhost)
	by gollem.swi.psy.uva.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id fB3LchU17921;
	Mon, 3 Dec 2001 22:38:43 +0100
Date: Mon, 3 Dec 2001 22:38:43 +0100
Message-Id: <200112032138.fB3LchU17921@gollem.swi.psy.uva.nl>
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Subject: Re: [SWIPL] How serialize Prolog database updates from multiple clients on Windows?
To: "Michael D. Kersey" <mdkersey@hal-pc.org>, prolog@swi.swi.psy.uva.nl
In-Reply-To: Michael D. Kersey's message of Mon, 03 Dec 2001 14:52:38 -0600
Phone: +31 - 20 - 525 6121

> I can execute SWI-Prolog as a CGI program on Apache web server running
> on Windows. But I also want to serialize Prolog database update requests
> from independent users so as to maintain the database's integrity. Does
> anyone know a straightforward way to do this?

The picture is a bit unclear.  What database are we talking about?
Each Prolog started as CGI program has its own database, but there is
no persistency.  You can of course make Prolog connect to a database
engine.  In that case the DBs transaction management should fix your
problem.  You can also use a Prolog file as `database', appending to
it.  In that case you need some file-locking to avoid making a mess of
your file on concurrect access.  This is provided in the current
version for POSIX systems, but not for the Windows version.

There are numerous other scenarios, so please be concrete in what you
want to solve using what start and constraints.

	--- Jan

