One of my Clients has a reservation based system. Similar to air lines. Running on MS SQL 2005.
The way the previous company has designed it is to create an allocation as a set of rows.
Simple Example Being:
AllocationId | SeatNumber | IsSold
1234 | A01 | 0
1234 | A02 | 0
In the process of selling a s...
My app is playing music, when the screen get lock/off, SOMETIMES there will be no sound.
Why?
Tnx
...
I've defined a class with a number of "observable" properties. Internally the class contains a single thread that performs I/O; e.g.
public class Foo {
private final PropertyChangeSupport support;
private State state;
public Foo() { this.support = new PropertyChangeSupport(this); }
public synchronized State getState() { retur...
Hi,
I need a lock in cocoa that does not use one cpu when I try to lock it and it is locked somewhere else. Something that is implemented in the kernel scheduler.
...
I have a Dictionary that tracks objects (ClientObject). Both the dictionary and ClientObject's are accessed by multiple threads. When I modify or read any object in this dictionary, I obtain a read or write lock on the dictionary using ReaderWriterLockSlim (rwl_clients) then obtain an exclusive lock on the actual object.
I just wanted t...
Is there a way to exclusively lock a table for reading in Oracle (10g) ? I am not very familiar with Oracle, so I asked the DBA and he said it's impossible to lock a table for reading in Oracle?
I am actually looking for something like the SQL Server (TABLOCKX HOLDLOCK) hints.
EDIT:
In response to some of the answers: the reason I nee...
I've been using lock on value type properties when multi-threaded access is required. Also, I've been meaning to become more diligent about applying proper access modifiers, especially in my library code that is starting to become useful in multiple projects. I've written some code and would like to request comments on the various stra...
Say I have this method:
def create_registration_unless_over_limit
if Registration.count < 50
Registration.create!
else
raise "too many registrations"
end
end
How do I ensure that I never have >= 50 registrations considering that I have more than one rails process running? Theoretically, isn't it possible that two reques...
I have cron job - php script which is called one time in 5 minutes. I need to be sure that previously called php script has finished execution - do not want to mix data that's being processed.
There are three approaches I used to apply:
Creation of auxiliary text file which contains running-state flag. Executed script analyzes the co...
I'm taking an intro class on database management systems, and had a question that wasn't answered by my book. This question is not from my homework, I was just curious.
The textbook continually stresses that a transaction is one logical unit of work. However, when coming across the shared/exclusive locking modes, I got a little confused...
Hello, I plan my java program to read a file which can be locked by another program to write into it so I need to check if the file is locked, if so wait until it is free and execute X function when free.
How to achieve this?
ps: the enviroment that my java program will run will be a Windows 2000 server
...
I'm creating an ASP.net website which handles thousands of requests and it all stems from one main object that they all share to read it. I'm trying to wrap my head around these different types of locks.
Some common questions i have for each.
What is the scope of each lock Application, Session,Object
When is it right to use one over t...
I have a large report I am running on sql server. It takes several minutes to run. I don't want users clicking run twice. Since i wrap the whole procedure in a transaction, how do I check to see if the table is locked by a transaction? If so I would want to return an error message saying "report generating, please try again in a few min...
Hello,
I did find other posts similar to this, but wanted a little extra information on these options of mysqldump. I have understood that the --single-transaction and --lock-tables are mutually exclusive operations. Following are my questions regarding these options.
a) Suppose I have chosen to use --lock-tables option. In this case t...
Hello :)
I have a logger class that handles various information display with pretty colors (yay.). However, since it writes to the console in separated steps (i.e. set color to red, write text, set color to gray, write text, for something that would render "[Error] Description..." with the error being in red), but I have a multithreaded...
Is it possible in DB2 to detect if the table is locked or not. Actually whenever we use Select statement and if that table is locked [ may be because of on going execution of insertion or deletion ] , then we have to wait till the table is unlocked.
In our application sometimes it goes to even 2-3 mins. What i think is, if i can have s...
I have seen many examples of the HOLDLOCK hint being used in combination with UPDLOCK (like this). However as I read the documentation for these hints, it seems that HOLDLOCK should be redundant, since UPDLOCK already persists the lock until the end of the transaction. (Also it seems to say that HOLDLOCK only applies to shared locks anyw...
I just read an article that describes how HttpApplicationState has AcquireRead() / AcquireWrite() functions to manage concurrent access. It continues to explain, that in some conditions however we need to use an explict Lock() and Unlock() on the Application object to avoid a Race condition.
I am unable to understand why a race conditi...
I am not sure how lock works.
What happens if I have a List<T> list and 2 threads ?
What happens if thread1 start running first and enumerate that list
foreach(T t in list)
{
// code
}
and in the same time, but after thread1 has started, thread2 will lock the list
lock(list)
{
// code
}
I use ThreadPool do to some processing a...
We are having some issues with our data layer when large datasets are returned from a SQL server query via a DataReader. As we use the DataReader to populate business objects and serialize them back to the client, the fetch can take several minutes (we are showing progress to the user :-)), but we've found that there's some pretty hard-c...