locking

How to perform a row lock?

I want to lock one record and then no one may make changes to that record. When I release the lock, then people may change the record. In the meantime that a record is locked, I want to show the user a warning that the record is locked and that changes are not allowed. How can I do this? I've tried all the IsolationLevel levels, but ...

How to detect a record is locked?

With SQL Server 2008, how can I detect if a record is locked? EDIT: I need to know this, so I can notify the user that the record is not accessible because the record is blocked. ...

Prevent simultaneous transactions in a web application

We have a web application (it is a game) with lots of various forms and elements which act as buttons and trigger some actions on server. The problem is that users can sometimes confuse our application if he clicks on buttons too fast or opens the website in two tabs and then issues some actions simultaneously. We have some basic protect...

Can I get fcntl and Perl alarms to cooperate?

I'm on linux, nfs, with multiple machines involved. I'm trying to use fcntl to implement filelocking. I was using flock until I discovered it only works between processes on the same machine. Now when I call fcntl with F_SETLKW, perl alarms (for adding a timeout) don't work as before. This would normally be ok, but ctrl-c doesn't reall...

Delphi Using LockFile on windows 7 64.

Hi All. I have found that if you open a file that resides on 32 bit server in a share folder from a 64 bit windows 7 machine, read it, lock it and then open it again. When you close all open handles the file actually remains open. The exact steps are: Place a file that is between 7000 and 10000 bytes long in a shared folder on a 32 ...

Futex based locking mechanism

Hello, Somebody can tell me an example of using locking mechanism based on futex? (for muticore x86 CPU, CentOS) Thanks Dima ...

[Android] How my app can unlock screen programatically ?

My application is launched on car docking event, i want to wake up phone (done by system) and unlock screen when i plug my device. Is it posssible ? ...

how to manage lock-write mechanism in django

hello. i've been searching for a while for a way to handle the lock-write mechanism in( whenever user is updating , the record should be locked for the others ) . and i've been told that the web-frame work is responsible for this. check this out : http://serverfault.com/questions/184666/how-to-configure-apache-server my question is : h...

How do I test for activity inactivity time

Hello, I'm wondering what is the highest level I can go in-order to know when the user interacts with my application preface: I'd like to logout of my application after X seconds of user inactivity. so what I did is create a service with a timer, and a toggle function which resets the timer to X time. after X time has passed, an intent ...

Does non-unique clustering key increase likelyhood of page level locks?

I have a table with many columns of which the total max size greatly exceeds the 8k boundary. This table contains a ModuleID column which basically tells u what type of object it is (dont worry - I didnt design this) of which there are maybe 15 different values. And then it has a unique column called propertyID which is also an IDENTITY(...

What's the right pattern for waiting on a file lock to be released?

I need to open a file but if it's currently not available I need to wait until it's ready. What's the best approach to take? SCENARIO I'm using files as a persistent caching mechanism for application data. This data needs to be read and deserialized often (written only once, and deleted occasionally). I have a cleanup process that runs...

A rather complicated Windows 7 64 bit to windows 32 bit server file locking issue

Possible Duplicate: Delphi Using LockFile on windows 7 64. Hi All. I have found that if you open a file that resides on 32 bit server in a share folder from a 64 bit windows 7 machine, read it, lock it and then open it again. When you close all open handles the file actually remains open. The exact steps are: Place a file...

Question about lock button of iPhone

Can the program stop to play the sound play after click the lock button? How to get the message of lock button through what interfaces? ...

SQL atomic increment and locking strategies - is this safe?

I have a question about SQL and locking strategies. As an example, suppose I have a view counter for the images on my website. If I have a sproc or similar to perform the following statements: START TRANSACTION; UPDATE images SET counter=counter+1 WHERE image_id=some_parameter; COMMIT; Assume that the counter for a specific image_id h...

What is the correct sequence in which cflock releases when using multiple locks in different functions?

Given the following scenario, I would like to know if functionOneLock releases itself before functionTwoLock is triggered, or does it wait until functionTwoLock releases first? <!--- functionOne() ---> <cffunction name="functionOne"> <cflock name="functionOneLock" type="exclusive"> <!--- do something ---> <cfset functionTwo()> </c...

Does MATLAB lock files when it opens them (Linux)?

I'm collecting data and would like to plot the results in Matlab as they're being collected. However it seems like the file would be locked while my scripts are running. Does anyone know if the Linux version of Matlab acts differently when it opens files, and leaves them writeable by other processes? ...

Why lock is needed to implement a readonly int property?

I'm new to threading and I came accross a custom thread pool implementation example in a blog. I'm pasting just the necessary parts of the code: Public Class ThreadPool Private CountLock As New Object Private _Count As Integer Public ReadOnly Property ThreadCount() As Integer Get SyncLock CountLock ...

Is the return value of Interlocked.Exchange also processed atomically?

In the following code: a = Interlocked.Exchange(ref b, c); I know b is set to c atomically. But is a also set to b in the same atomic operation? Or is this outside of the atomic operation. What I need is to ensure both a and b are set in the same atomic operation. c => b, b => a This is in C#.Net. ...

Tortoise SVN - Case sensitivity issue under Windows - Problem Merging

I have been working in a branch for a couple months and am now trying to merge the trunk into the branch, before finally merging my branch into the trunk. After successfully merging a few revisions, SVN threw an error about the "bin" folder being locked. When I created my branch, the folder was called "Bin", but at this particular revi...

How to use lock_guard when returning protected data

I have a question concerning the use of boost::lock_guard (or similar scoped locks) and using variables that should be protected by the lock in a return statement. How is the order of destroying local objects and copying the return value? How does return value optimization affect this? Example: Data Class::GetData() { boost::lock_...