J
james
Hi
Apologies if this is the incorrect group for this post.
I have a Windows Service running that populates a database and a Web
Service that accesses the same SQL 2000 database.
One of my tables within the database records the filenames of files
within a number of folders. If a folder changes, all records for that
folder are deleted and a new set of records inserted. This is achieved
by calling an insert record stored procedure a number of times.
The Web Service periodically request a list of files for a particular
folder.
I am keen to prevent the situation that the records are being updated
by the Windows Service while the Web Service is requesting a new set of
records. This would lead to problems.
I would value any suggestions as to the correct approach to resolve
this problem. Should I have a flag somewhere within the database that
says that an update is in progress? Can I lock the table in some way?
Should I forget about the database and store the file list in another
way that prevents this sort of problem from occurring?
Thanks
James
Apologies if this is the incorrect group for this post.
I have a Windows Service running that populates a database and a Web
Service that accesses the same SQL 2000 database.
One of my tables within the database records the filenames of files
within a number of folders. If a folder changes, all records for that
folder are deleted and a new set of records inserted. This is achieved
by calling an insert record stored procedure a number of times.
The Web Service periodically request a list of files for a particular
folder.
I am keen to prevent the situation that the records are being updated
by the Windows Service while the Web Service is requesting a new set of
records. This would lead to problems.
I would value any suggestions as to the correct approach to resolve
this problem. Should I have a flag somewhere within the database that
says that an update is in progress? Can I lock the table in some way?
Should I forget about the database and store the file list in another
way that prevents this sort of problem from occurring?
Thanks
James