Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.12.0] - 2022-02-23

# Added

- Allow starting transactions with lower isolation level (the default is SERIALIZABLE) through an optional flag in startTransaction

## [2.11.0] - 2022-01-14

# Added
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java-library'
}

version = "2.11.0"
version = "2.12.0"

repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
import io.supertokens.pluginInterface.exceptions.StorageTransactionLogicException;

public interface SQLStorage extends Storage {
<T> T startTransaction(TransactionLogic<T> logic, TransactionIsolationLevel isolationLevel)
throws StorageQueryException, StorageTransactionLogicException;

<T> T startTransaction(TransactionLogic<T> logic) throws StorageQueryException, StorageTransactionLogicException;

void commitTransaction(TransactionConnection con) throws StorageQueryException;
Expand All @@ -34,4 +37,8 @@ public interface SQLStorage extends Storage {
interface TransactionLogic<T> {
T mainLogicAndCommit(TransactionConnection con) throws StorageQueryException, StorageTransactionLogicException;
}

public enum TransactionIsolationLevel {
SERIALIZABLE, REPEATABLE_READ, READ_COMMITTED, READ_UNCOMMITTED, NONE
}
}