I run a similar type of procedure that updates from an OBDC connection every 10 minutes.
I load the OBDC data into a temp table (OpenCallTemp), process it, delete the rows from the fixed table (OpenCallData) and then append the temp table to the fixed table.
The database has a "control" table called "ProcessStatus". This table contains a column indicating the status of the update, and the date and time of the last data refresh.
During the append procedure (which only last about 10 seconds), I change the value of the "ProcSts" column to "Y".
If a user tries to access OpenCallData, the routine first checks the value of ProcSts. If the value = "Y", then the user gets a message informing that a data update is in progress. They are then returned to the menu.
In the event that the user is already in OpenCallData when the append occurs, they are not affected since they are working with their own "temp" copy of OpenCallData. I also display the "Last Data Refresh" date and time on the users screen.
Hope this helps.
Rich Young
Advance Business Systems
10755 York Road
Cockeysville, Maryland 21030
(410) 252-4800
[EMAIL PROTECTED]
-----Original Message-----
From: CASTANARO [mailto:[EMAIL PROTECTED]]
Sent: Sunday, November 25, 2001 11:24 PM
To: RBase List
Subject: Table Locks
Hello all,
I have an R:base command file that runs automatically every hour (many
thanks to Ian Stone for his utility). This command file downloads data via
ODBC to a table and then performs some R:Base wizardry for about 5 minutes.
The problem is - i have users who access this table to print a report,
sometimes unknowingly while this command file is running. Obvoiusly, when
the command file is running the data is changing frequently. i would like
to prohibit access to this table while the command file is running. tried
"SET LOCK tablename ON" but other users still can print report. I guess
this just means it locks out writes to the table. Is there a command I'm
missing to temporarily suspend read of the table? There are no passwords
on this database.
Thanks
