I have postgresql (in perlu) function getTravelTime(integer, timestamp), which tries to select data for specified ID and timestamp. If there are no data or if data is old, it downloads them from external server (downloading time ~300ms).
Multiple process use this database and this function. There is an error when two process do not fin...
In our production database, we ran the following pseudo-code SQL batch query running every hour:
INSERT INTO TemporaryTable
(SELECT FROM HighlyContentiousTableInInnoDb WHERE allKindsOfComplexConditions are true)
Now this query itself does not need to be fast, but I noticed it was locking up HighlyContentiousTableInInnoDb, even though i...
I'm building a Sinatra based app for deployment on Heroku. You can imagine it like a standard URL shortener but where old shortcodes expire and become available for new URLs (I realise this is a silly concept but its easier to explain this way). I'm representing the shortcode in my database as an integer and redefining its reader to give...
I have some logic in before_save whereby (only) when some conditions are met I let the new row be created with special_number equal to the maximum special_number in the database + 1. (If the conditions aren't met then I do something different, so I can't use auto-increments)
My worry is that two threads acting on this database at once m...
Is there a way to receive a notification when the iPad gets orientation locked? When the orientation lock is set on or off, it does send a receivedRotate: notification, but I need a way to be able to distinguish normal rotations from lock "rotations".
The problem is I am rotating things in my view when the rotation changes. When the loc...
Silverlight uses an IsolatedStorageFileStream to open files.
The IsolatedStorageFileStreamunder NET.4 claims to support the Lock Method (Inherited from FileStream)
The following code
IsolatedStorageFile isf;
IsolatedStorageFileStream lockStream = new IsolatedStorageFileStream( "my.lck", FileMode.OpenOrCreate, isf );
lockStream.Lock(...
Im currently reading the Book Java Concurrency in Practice. In the Chapter 15 they are speaking about the Nonblocking algorithms and the compare-and-swap (CAS) Method.
It is written that the CAS perform much better than the Locking Methods. I want to ask the people which already worked with both of this concepts and would like to hear ...
Hi all!
I will describe my problem for an easier explanation:
I have a table and my soft is accessing it (update, insert) using transaction.
The problem is that I want to enable DIRT READ in this table. But I cant use with (nolock) in my sql statements because I cant change the soft source. So I was thinking in enable dirty read in th...
I'm wondering what is actually stored in a CouchDB database B-tree? The CouchDB: The Definitive Guide tells that a database B-tree is used for append-only operations and that a database is stored in a single B-tree (besides per-view B-trees).
So I guess the data items that are appended to the database file are revisions of documents, no...
Greetings,
I'm evaluating some components for a multi-data center distributed system. We're going to be using message queues (via either RabbitMQ or Qpid) so agents can make asynchronous requests to other agents without worrying about addressing, routing, load balancing or retransmission.
In many cases, the agents will be interacting w...
I have this code that saves a pdf file.
FileStream fs = new FileStream(SaveLocation, FileMode.Create);
fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
fs.Flush();
fs.Close();
It works fine. However sometimes it does not release the lock right away and that causes file locking exceptions with functions run after this on...
I have an ASP.Net webpage where the user selects a row for editing. I want to use the row lock on that row and once the user finishes the editing and updates another user can edit that row i.e. How can I use rowlock so that only one user can edit a row?
Thank you
...
The System.Reactive.dll adds a class AsyncLock to System.Concurrency.
It has a single instance method, Wait, that takes an Action.
The documentation page I found just tells it it pre-release documentation,
so I ask here: What does this class do?
...
My MysQL database contains multiple MyISAM tables, with each table containing millions of rows. There is a heavy insert load on the database, so I cannot issue SELECTs on that live database. Instead, I create a replica of the database for queries and conduct analysis on that.
For the analysis, I need to issue multiple parallel queries....
I am building a system using NServiceBus and my DataLayer is using Linq 2 SQL.
The system is made up of 2 services.
Service1 receives messages from NSB.
It will query Table1 in my database
and inserts a record into Table1
If a certain condition is met a new NSB message is sent to the 2nd service
Service2 will update records also in Ta...
I have some records, that I want to save to database asynchronously. I organize them into batches, then send them. As time passes, the batches are processed.
In the meanwhile the user can work on. There are some critical operations, that I want to lock him out from, while any save batch is still running asynchronously.
The save is don...
I have a problem understanding read consistency in database (Oracle).
Suppose I am manager of a bank . A customer has got a lock (which I don't know) and is doing some updating. Now after he has got a lock I am viewing their account information and trying to do some thing on it. But because of read consistency I will see the data as ...
Hello,
I have been looking around for the answer to this, but no joy. In Java, is using the lock created by ReentrantReadWriteLock equivalent to getting the read and write locks as returned by readLock.lock() and writeLock.lock()? In other words, can I expect the read and write locks associated with the ReentrantReadWriteLock to be re...
Hi,
I have a program (C#) with a list of tests to do.
Also, I have two thread. one to add task into the list, and one to read and remove from it the performed tasks.
I'm using the 'lock' function each time one of the threads want to access to the list.
Another thing I want to do is, if the list is empty, the thread who need to read from ...
We have a system that uses sp_getapplock to create an exclusive mutex any time someone opens an order in the GUI. This is used to prevent multiple people from making changes to an order simultaneously.
Sometimes people will open an order and go home, leaving it open. This effectively blocks anyone from being able to make changes to the ...