Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement SQL query transaction isolation level from Akka.NET 1.5.3 #301

Merged

Conversation

Arkatufus
Copy link
Contributor

Changes

  • Implement SQL transaction IsolationLevel in settings
  • Add unit tests

using (var conn = new SqlConnection(ConnectionString))
var oldDatabaseName = _builder.InitialCatalog;
var databaseName = $"akka_persistence_tests_{Guid.NewGuid()}";
_builder.InitialCatalog = databaseName;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a new database for each unit tests to prevent cross-polination between unit tests

Context.System.Serialization,
GetTimestampProvider(config.GetString("timestamp-provider")));
}

[InternalApi]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static QueryConfiguration CreateQueryConfiguration(Config config, JournalSettings settings)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move out QueryConfiguration creation so that is testable

Context.System.Serialization);
}

[InternalApi]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static QueryConfiguration CreateQueryConfiguration(Config config, SnapshotStoreSettings settings)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move out QueryConfiguration creation so that it is testable

defaultSerializer: config.GetString("serializer"),
useSequentialAccess: config.GetBoolean("sequential-access"),
readIsolationLevel: settings.ReadIsolationLevel,
writeIsolationLevel: settings.WriteIsolationLevel);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass in new isolation level arguments

defaultSerializer: config.GetString("serializer"),
useSequentialAccess: config.GetBoolean("sequential-access"),
readIsolationLevel: settings.ReadIsolationLevel,
writeIsolationLevel: settings.WriteIsolationLevel);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass in new isolation level arguments

@Aaronontheweb Aaronontheweb merged commit f1754fb into akkadotnet:dev Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants