Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Design Issue with Database Access

Posted on 2006-07-19
1
Medium Priority
?
222 Views
Last Modified: 2010-04-23
Hi

I have a database that can be accessed at any point in time to retrieve data. The database also periodically gets updated with information from a text file that the program imports.

Is there any nice way to restrict access to the database while the database is been updated and make any other requests wait until it has finished?

Thanks
Adam
0
Comment
Question by:adam_pedley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 6

Accepted Solution

by:
Nandakumar Sakthivel earned 2000 total points
ID: 17136863

If you want to stop accessing the Tables for the particular table means you can acheive this by using transaction objects
using  "SqlCon.BeginTransaction(IsolationLevel.RepeatableRead)"


       Dim sqlCmd As SqlCommand
       Dim SqlCon As SqlConnection
       Dim trans As SqlTransaction

            SqlCon = New SqlConnection("")
            SqlCon.Open()
            sqlCmd = New SqlCommand
            trans = SqlCon.BeginTransaction(IsolationLevel.RepeatableRead)
            sqlCmd.CommandTimeout = 0
            sqlCmd.Connection() = SqlCon
            sqlCmd.CommandType = CommandType.Text
            sqlCmd.Transaction = trans
     
It is a way called pessimistic locking

http://builder.com.com/5100-6388-1049842.html

Thanks,
Nanda
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question