Book Image

Learning NServiceBus - Second Edition

By : David Boike
Book Image

Learning NServiceBus - Second Edition

By: David Boike

Overview of this book

Table of Contents (18 chapters)
Learning NServiceBus Second Edition
About the Author
About the Reviewers

Fault tolerance and transactional processing

In order to understand the fault tolerance we gain from using NServiceBus, let's first consider what happens without it.

Let's order something from a fictional website and watch what might happen to process that order. On our fictional website, we add Batman Begins to our shopping cart and then click on the Checkout button. While our cursor is spinning, the following process is happening:

  1. Our web request is transmitted to the web server.

  2. The web application knows it needs to make several database calls, so it creates a new transaction scope.

  3. Database Call 1 of 3: The shopping cart information is retrieved from the database.

  4. Database Call 2 of 3: An Order record is inserted.

  5. Database Call 3 of 3: We attempt to insert OrderLine records, but instead get Error Message: Transaction (Process ID 54) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

  6. This exception causes the transaction...