locking

What happens if two people submit edits at once

Hi there, This might be a stupid questions but I wanted to know what happens if two users edit some data at once and then both click submit at the same time, I assumed Rails handled requests one after the other and so someone would get an error message but is this correct? Thanks Once one person has edited data I dont want it to be ac...

Postgresql: Implicit lock acquisition from foreign-key constraint evaluation

So, I'm being confused about foreign key constraint handling in Postgresql. (version 8.4.4, for what it's worth). We've got a couple of tables, mildly anonymized below: device: (id, blah, blah, blah, blah, blah x 50)… primary key on id whooooole bunch of other junk device_foo: (id, device_id, left, right) Foreign key (...

Does YourKit report ReentrantLocks?

I am trying to reduce the lock contention on a particular code-path in my application. To identify code with high lock contention, I connect YourKit to my application and use the "Monitor" tab and see acquiring which locks have caused the thread I care about to block. My eventual aim is to have no red dots for this thread in the "Thread"...

Java synchronized method lock on object, or method?

If I have 2 synchronized methods in the same class, but each accessing different variables, can 2 threads access those 2 methods at the same time? Does the lock occur on the object, or does it get as specific as the variables inside the synchronized method? Example: class x{ private int a; private int b; public synchronize...

C# Web Service gets stuck waiting for lock, does not return

We have a C#(2.0) application which talks to our server(in java) via web services. Lately we have started seeing following behavior in (ONLY)one of our lab machines(XP): Once in a while(every few days), one of the webservice request will just get stuck, will not return or timeout. Following is the stacktrace where it seem to be stuck. ...

Android pattern locking

I have been able to lock the screen using LOCK_PATTERN_ENABLED, however in many cases when I enable this pattern locking it will take any pattern and move past the pattern check. Has anyone else run across this? ...

creating a static vb.net "app" that consist of a single picture

I need to create a vb.net program that consists of a unmovable, always on top bitmap, with no menu bar or anything, and does not show up in the task bar as program. It needs to always start in the same place. Essentially I need to mask a part of the screen by using a bitmap that blends into the scenery. I am not sure which properties I...

Oracle grant concession and side effects

Working every day on a large Oracle production database (10g), we noticed that operations like granting an user read privileges on a table creating a trigger on a table lock that table, and invalidate all the cursors insisting on it. This has tremendous consequences if the table is big (> 20 million rows) and many users are working ...

LOCK TABLE as a prepared statement?

Does it make sense to prepare a LOCK TABLE statement? I'm not really concerned about efficiency here, because it would only execute once a transaction and at most a few times a minute. I'm more wondering if the concept is meaningful. I'm using the PostgreSQL JDBC driver, if it matters. ...

Oracle locking with SELECT...FOR UPDATE OF

I'm selecting from tables FOO and BAR. I'd like to lock the records of FOO which are being returned, but I don't want the records of BAR to be locked. cursor c_foobar is select foo.*, bar.* from foo, bar where foo.id = bar.foo_id for update of <what should I put here?> It seems like I need to specify individual columns, but I want t...

Locking mechanisms for shared-memory consistency

Hi all, I'm developing a mechanism for interchanging data between two or more processes using shared memory on linux. The problem is some level of concurrency control is required to maintain data integrity on the shared memory itself, and as I'm specting that sometime or another my process could be killed/crash, common lock mechanisms d...

Can I lock rows in a cursor if the cursor only returns a single count(*) row?

I would like to restrict users from inserting more than 3 records with color = 'Red' in my FOO table. My intentions are to A) retrieve the current count so that I can determine whether another record is allowed and B) prevent any other processes from inserting any Red records while this one is in process, hence the for update of. I'd l...

Weird Locks Problem in MySQL

Hi! Quite often my Server hangs and MySQL shows the following process list: Process 1: Time: 24 User: Worker Status: Locked Info: LOCK TABLES tRatings WRITE, tUsers WRITE Process 2: Time: 24 User: Worker Status: Updating Info: UPDATE tUsers SET fGender = '1' WHERE fID = 232049 Process 3: Time: 24 User: Worker Status: Locked Info: LOC...

How To Create Resource Manager for Multi-Threaded Environment?

I have a pool of connections. The exact nature of them isn't particular important in this case - think of them like primitives that can be passed around freely. In a multi-threaded environment, I want to create a resource manager on which I can call "acquire()" to gain exclusive access to a connection in a thread, and subsequently "relea...

What locks are enforced by SQL Server 2005 Express ?

Consider a web page having grid-view connected to SqlDataSource having all permission to insert update and delete. Publish the web page. This is all on one computer local Now opening website on browser A - pressing edit of grid-view opening website on broswer B - pressing edit of grid-view. Now I edit in both browsers and press u...

How to prevent a method of a class to be called before the class is ready ?

Still exploring C# ... so bare with me please. Here is my custom "logger" class, which helps me create logs file in my project. namespace MyProject { class Logger { private FileInfo fFile; private DirectoryInfo dDir; /// <summary>Add a new entry to the log file.</summary> /// <param name="sData">The line to add.</param...

Reading/writing of reference typed field by multiple threads WITHOUT lock

Context: highly threaded server-side application with many reads, occasional writes. Let us consider the following simple code: [Serializable] public class BusinessObject { // ... lot's of stuff, all READ ONLY!!! } public class BusinessObjectHost { private BusinessObject bo; public BusinessObject BO { get { retu...

jQuery ajax requests locking IE8. Cannot click to another page until request completes.

I cannot seem to find anything about an async request locking up IE8 but it is happening to me. The browser will not allow navigation away from the current page until the request completes. Example: if I open page the script below does a request to place icons on a page based on additional data not available while building the page. Wh...

MySQL Full Text Query Locking Table

Every once in a while we get a particularly long running full text query in MySQL. The query will run for a very long time, currently I'm seeing one that's running for 50,000 seconds (and still going). Using Kill, or Kill Query on the query seems to do nothing. Also, the command Timeout on the client side is 30 seconds, so the client ...

UIWebView as part of a UITableViewCell: leading to crash because of a thread lock

Hi everybody, I'm trying to add a UIWebView as a subview of a UITableViewCell in order to display some data formatted with MIMEType 'application/xhtml+xml'. Even just initializing the UIWebView as described in the following code leads the application to crash! - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath...