Version number or timestamp for optimistic concurrency?
Would you rather use a version number (that will increment) or a timestamp to check for concurrency problems? ...
Would you rather use a version number (that will increment) or a timestamp to check for concurrency problems? ...
Say that I have the following code: ExecutorService executor = Executors.newSingleThreadExecutor(); executor.execute(myRunnable); Now, if myRunnable throws a RuntimeExcpetion, how can I catch it? One way would be to supply my own ThreadFactory implementation to newSingleThreadExecutor() and set custom uncaughtExceptionHandlers for the...
I remember seeing a link about it here where some people claimed it's 1000 times faster than the BCL Linq. Anyone used it here? Is it true? Also is Microsoft's PLinq gonna be along the same lines? Because it seemed to me like the above mentioned Linq was automatically parallel or something. And if that's the case, why isn't Microsoft ...
In Sharepoint MOSS multiple users can edit the same item in a sharepoint list at the same time…the first person to save their edit “wins”. Is there a way to prevent this, to lock the list item while it is being edited? NB: This refers to a custom list -Not a document in a document library ...
We have been using Doug Lea's concurrent library for more than 8 years now. For backwards compatibility reasons our code was restricted to use Java 2 language level and JDK 1.3 library. Now we are working on a major new release and are finally able to use Java 5 features. We think we should move from using the "old" concurrency library...
Hi all, I'm having some problems with a small ircbot i'm writing. Basically I connect to the server using a tcpclient in a seperate class, which also runs on its own thread. I want to display the server text in a richtextbox control on the main form. The big issue I'm having is that as soon as the text starts coming in the whole applica...
I've been doing some web development work in PHP recently which has led me to study up on the language in general. So far I have not needed to use it to interact with a database, but I know it provides a lot of convenient functions for doing so. Although I know basic SQL and have worked with basic manipulation of data in a database, I d...
I am a user of a some host company which serves my MySql database. Due to their replication problem, the autoincrement values increses by 10, which seems to be a common problem. My question is how can I simulate (safely) autoincrement feature so that the column have an consecutive ID? My idea was to implement some sequence mechanism ...
Lets say i have to orchestrate a synchronization algorithm in .net 3.5 SP1 and any of the synchronization primitives listed in the title fit perfectly for the task. From a performance perspective, is any of those more performant than the other? I ask this because I have been coding for a while now, but without proper knowledge on the s...
I'm occasionally but quite often getting an unhandled exception in cursor.execute (django1.1/db/models/sql/query.py line 2369), using psycopg2 with postgresql. Looks like the database drops connection in some way, so Django crashes. For unhandled exception there is a ticket in Django's bugtrack (#11015), but I'm rather interested in re...
What books/resources have people found useful on the topic for .Net? ...
The classical unit testing is basically just putting x in and expecting y out, and automating that process. So it's good for testing anything that doesn't involve time. But then, most of the nontrivial bugs I've come across have had something to do with timing. Threads corrupt each others' data, or cause deadlocks. Nondeterministic behav...
How to implement 10k connections echo server in Clojure? clojure.contrib.server-socket is not the answer since it crates a new OS thread for every connection. ...
Hi all expert, Pls give me the solutions for this two problem, which i was asked recently in interview. Prob1: Suppose I have application with 10 admin, so they can change the data anytime their having own userid and password. For example, one user retrieve one data from database table, while retrieving it value was 2, after retrievin...
I've only just recently learned about Google's programming language, Go. I've been intrigued by its offered support for concurrency, and set out to learn more about it. However, I went looking to see how Go implemented a particular feature of concurrency, and so far I haven't seen any evidence at all that this feature is there at all. ...
I have a simple problem. I have to fetch a url (about once a minute), check if there is any new content, and if there is, post it to another url. I have a working system with a cronjob every minute that basically: for link in models.Link.objects.filter(enabled=True).select_related(): # do it in two phases in case there is cross pol...
In the application that I'm currently working on, it is possible for multiple users to want to edit something at the same time which means that we need to implement optimistic locking. However, for this application, the item being edited is a scientific protocol that contains records from multiple different tables in the database. As s...
Does singleton/session scopes of Spring beans require that access to all its fields must be synchronized? Say through "synchronized" keyword or using some classes from package "java.util.concurrent". As example, is this code not thread safe? (copy/pased from here): @Component @SessionScoped public class ShoppingCart { private List<...
I have two applications running on a machine, where NHibernate is used as an ORM. One app is managing objects (CRUD operations), while the other is processing the objects (get, process, set status and save). First I let the processing app process an object and set the status to processed. Then I change a text property manually in the da...
Hi, according to the Berkeley documentation the Transactional (TS) and the Concurrent Datastore version of the Database, multiple threads may access (and change) the database. Does this also mean that I can have 2 programs linked to the berkely 'client' and have them access the same database file without any problems? (I ask, since f...