IsolationLab is a C# console application that demonstrates SQL Server isolation levels using file-based transaction simulation. It allows users to experiment with Read Uncommitted and Read Committed isolation levels, simulating concurrent access and transaction control.
- Simulates SQL Server isolation levels:
- Read Uncommitted (NOLOCK)
- Read Committed (default)
- File-based transaction log and data storage
- Supports basic transaction commands:
SELECT,COMMIT,ROLLBACK - Demonstrates locking and rollback behavior
Program.cs– Entry point, session selection, and orchestrationReadUncommittedSession.cs– Logic for Read Uncommitted isolationReadCommittedSession.cs– Logic for Read Committed isolation, including file-based lockingMessageReader.cs– Reads data and log filesMessageWriter.cs– Writes to data and log files, handles commit and rollbackIsolationLevel.cs– Enum for supported isolation levelsdata/data.txt– Simulated database tabledata/log.txt– Transaction log
- Build the project
Open a terminal in theIsolationLabdirectory and run the following commands:
dotnet build
dotnet run --project IsolationLab