16.10.2015 Views

Getting Started with DB2 Express-C

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

218 <strong>Getting</strong> <strong>Started</strong> <strong>with</strong> <strong>DB2</strong> <strong>Express</strong>-C<br />

Figure 13.4 – Lost Update<br />

In Figure 13.4 there are two applications attempting to update the same row. The one on<br />

the left is application App1, and the one on the right is application App2. The sequence of<br />

events is then:<br />

1. App1 updates a row<br />

2. App2 updates the same row<br />

3. App1 commits<br />

4. App2 commits<br />

App1's update is lost when App2 make its update, hence the term “Lost Update”.<br />

13.3.2 Uncommitted read<br />

An uncommitted read, or “dirty read” allows for an application to read information that has<br />

not been committed, and therefore is not necessarily accurate.<br />

Figure 13.5 – Uncommitted Read<br />

Figure 13.5 follows this sequence of events:<br />

1. App1 updates a row<br />

2. App2 reads the new value from that row<br />

3. App1 rolls back its changes to that row<br />

App2 is reading uncommitted data, and hence invalid data, which is why this problem is<br />

called an “uncommitted read”

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!