Interactive simulator for testing and visualizing SQL Server isolation level behaviors under concurrent transactions.
- Simulates concurrent database transactions
- Demonstrates:
- Dirty Reads
- Non-repeatable Reads
- Phantom Reads
- Deadlocks
- Visualizes the impact of different isolation levels
- Calculates execution time and logs deadlock status
- Read Uncommitted
- Read Committed
- Repeatable Read
- Serializable
This project uses the AdventureWorks2022 sample database to simulate real-world concurrent transactions.
💡 Please download and restore the
.bakfile in your SQL Server instance before running the simulation.
📥 Download AdventureWorks2022.bak
(Official link from Microsoft SQL Server Samples)
- Open SQL Server Management Studio (SSMS)
- Right-click
Databases→Restore Database - Select the
.bakfile and restore it asAdventureWorks2022
- C# (.NET Framework) – UI and transaction simulation logic
- SQL Server – For executing concurrent transactions
- ADO.NET – Database access and command execution
- Windows Forms – User interface
- Multithreading – Simulating parallel operations
- Visual Studio 2019 or newer
- SQL Server (Express or LocalDB)
- AdventureWorks2022 sample database
- Clone the repository:
git clone https://github.com/your-username/SqlIsolationLevelsSimulator.git-
Open
SqlIsolationLevelsSimulator.slnin Visual Studio -
Make sure SQL Server is running and the
AdventureWorks2022database is restored -
Update
App.configif needed:
<connectionStrings>
<add name="DefaultConnection"
connectionString="Data Source=localhost;Initial Catalog=AdventureWorks2022;Integrated Security=True" />
</connectionStrings>- Run the app with F5
- Isolation Level: Repeatable Read
- Transaction A: Update operation
- Transaction B: Select → Delay → Select again
- ❌ Deadlock: No
- ⏱ Execution Time: 426 ms
Esma Şen