473,834 Members | 1,800 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows Service, Web Service and SQL Server Database Locking

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

Aug 22 '06 #1
1 2482
<ja***@instante commerce.co.ukw rote in message
news:11******** **************@ 75g2000cwc.goog legroups.com...
I have a Windows Service running that populates a database and a Web
Service that accesses the same SQL 2000 database.
<snip>
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?
You should be writing the records within a SQL transaction. Then based on
your record locking scheme (optimistic, pessimistic, etc.), you may need to
handle DBConcurrency exceptions.

You may get better advice over in the m.p.d.framework .adonet newsgroup.

-- Alan
Aug 22 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
2739
by: Mark C. | last post by:
The company I work for has been running Access 2000 on a Windows NT server with Opportunistic Locking turned off on the server without issue for almost a year. We have just switched to a Windows 2000 file server with service pack 3 installed and are now experiencing at least 2 corruptions a day. The registry setting for Opportunistic Locking that was on the Windows NT server does not exist on the Windows 2000 server so we can not make the...
1
1587
by: Mark | last post by:
The company I work for has been running Access 2000 on a Windows NT server with Opportunistic Locking turned off on the server without issue for almost a year. We have just switched to a Windows 2000 file server with service pack 3 installed and are now experiencing at least 2 corruption's a day. The registry setting for Opportunistic Locking that was on the Windows NT server does not exist on the Windows 2000 server so we can not make the...
6
2267
by: alanknipmeyer | last post by:
Hi, I`m in the process of migrating a Access 2002 (Run in 2000 mode) from Windows 98 to Win2K Server. It is a shared resource via a file share on the 98 Server. Client systems are Win98 with the shared drive mounted and the application run via the shared drive. I have tried once before, but came across some file locking issues. I thought i had addressed these file locking issues, but it came apparent I hadn't when data started to get...
0
3173
by: Andrew Dowding | last post by:
Hi Everybody, I have been looking at problems with my Windows Forms C# application and it's little Jet 4 (Access) database for the last few days. The Windows Forms app implements a facade and implementation, data abstraction layer. But because each data adapter in the implementation layer has a connection object that opens and closes as needed, I found I got several errors from the Jet engine when there were simultaneous connections to...
3
3501
by: Evan Camilleri | last post by:
I have a problem for a Windows Service to login on an SQL server (different machine) - neither Windows Authentication nor SQL Authentication worked. LOGIN FAILED FOR USER sa (for example). If SQL Server is on the same PC of the Windows Service the connection works OK. The same code works in a Windows Form using same user and authentication methods to the SQL Server on a different machine.
4
3711
by: Andy Baker | last post by:
I have an Windows forms application written in VB.NET that uses a SQL Server 2000 back end database with Windows authentication. There is no problem accessing the database from my application, or from an installed version of the application on another machine. My problem is that I would like to access the database overnight unattended to perform some maintenance tasks. With my fairly limited knowledge of SQL Server and VB.NET, I thought...
5
2009
by: cityrock | last post by:
Hello friends. It has come time for me to face a dilema i have been thinking about for a long time, but actually doing nothing. Now its time to act. The situation is "simple", and i have just spent hours reading other posts regarding the advantages and disadvantages upgrading my mdb (jet engine) to an sql BE. I am the system engineer, administrator and programmer of our company's database. Our mdb FE is very complex, using hundreds of...
0
1488
by: JM | last post by:
I am working on an application which uses xml file as a database. The application has 2 interfaces which accesses this xml file. "Windows application written in C#" and "Windows Service written in C#". Both have been developed in .NET Framework 2.0. Recently I have started getting error in Windows application that "xml file is being locked by some other process". I have debugged and find out that its my Windows Service which is locking...
5
4524
by: JM | last post by:
I have created a Windows Service which uses xml file as a data source. The service is running on .NET 2.0 and uses LocalSystem account. It was running fine but now it has started locking the xml file sometimes. When I stop the service it unlocks the file.The service is running all time. And it locks xml file sometimes not always. I would really appreciate if anybody can guide me here. Thanks
0
9800
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9651
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10516
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10556
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6960
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5629
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5800
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3085
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.