sql locking on silverlight app
        Posted  
        
            by immuner
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by immuner
        
        
        
        Published on 2010-04-16T01:05:38Z
        Indexed on 
            2010/04/16
            1:13 UTC
        
        
        Read the original article
        Hit count: 405
        
Hi, i am not sure if this is the correct term, but this is what id like to do: I have an application that uses a mssql database. This application can operate in 3 modes. mode 1) user does not alter, but only read the database mode 2) user can add rows (one at a time) onto a table in the database mode 3) user can alter several tables in the database (one person at a time)
question 1) how can i ensure that when a user in in mode 3 that the database will "lock" and all logged in users who operate in mode 2 or mode 3 will not be able to change the database until he finishes? question 2) how can i ensure that while there are several users in mode 2, that there will be no conflict while they all update the table? my guess here, is that before adding a new row, you make a server query for the table's current unique keys and add the new entry. will this be safe enough though?
Thanks
© Stack Overflow or respective owner