Skip to content

Demonstration of Snapshot Isolation using MVCC (Multi-Version Concurrency Control)

Notifications You must be signed in to change notification settings

Sdaas/SnapshotIsolationDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This application shows a simple implementation of Snapshot Isolation.

From wikipedia - "snapshot isolation is a guarantee that all reads made in a transaction will see a consistent snapshot of the database (in practice it reads the last committed values that existed at the time it started), and the transaction itself will successfully commit only if no updates it has made conflict with any concurrent updates made since that snapshot."

Important Files

  • Transaction : Keep track of maximum committed transaction and all transactions that were in flight when this was created.
  • TransactionManager : generates new transactions, and keeps track of transactions in flight.
  • Account : A record in the data store. Keeps a versioned history of its balances.
  • AccountEntry : A single entry in an Account's history.
  • Bank : Contains a collection of accounts and provides methods to transfer money.
  • BankDemo : Illustrates the effect of snapshot isolation.

Instructions

  • mvn clean
  • mvn install
  • export CLASSPATH="target/SnapshotIsolationDemo-1.0-SNAPSHOT.jar"
  • java com.daasworld.BankDemo

References

About

Demonstration of Snapshot Isolation using MVCC (Multi-Version Concurrency Control)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages