Articles

Thread debugging has the reputation of being one of the most arduous tasks for developers. I beg to differ. Asynchronous debugging is so much worse. It’s supposed to solve threading problems, and to some degree, async helps… But it doesn’t make debugging simpler. I will get into that in the next post.

Today we’ll discuss the process of debugging threading issues and dealing with deadlocks and race conditions in the debugger.

Source de l’article sur DZONE

There exists two types of synchronisation techniques to make sure you avoid concurrency issues and race conditions when updating database records. These are as follows.

  • Optimistic locking
  • Pessimistic locking

Optimistic locking is usually performed by using native database mechanism such as RowVersion in SQL Server, TimeStamp in MySQL, or ETag in Cosmos DB. These are special field types that changes automatically as the record is updated, allowing you to inject the values of these fields as a criteria to your update invocations. For an example of how this works, imagine the following schema.

Source de l’article sur DZONE