Skip to content

Commit

Permalink
Minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Tapac committed Feb 19, 2022
1 parent 1351ce8 commit c80c18f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,8 @@ class Database private constructor(
fun getDefaultIsolationLevel(db: Database): Int =
when (db.dialect) {
is SQLiteDialect -> Connection.TRANSACTION_SERIALIZABLE
is OracleDialect -> Connection.TRANSACTION_READ_COMMITTED
is PostgreSQLDialect -> Connection.TRANSACTION_READ_COMMITTED
is SQLServerDialect -> Connection.TRANSACTION_READ_COMMITTED
else -> DEFAULT_ISOLATION_LEVEL
is MysqlDialect -> Connection.TRANSACTION_REPEATABLE_READ
else -> Connection.TRANSACTION_READ_COMMITTED
}

private fun getDriver(url: String) = driverMapping.entries.firstOrNull { (prefix, _) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ interface TransactionInterface {
fun close()
}

@Deprecated("There is no single default level for all databases, please don't use that constant")
const val DEFAULT_ISOLATION_LEVEL = Connection.TRANSACTION_REPEATABLE_READ

private object NotInitializedManager : TransactionManager {
Expand Down

0 comments on commit c80c18f

Please sign in to comment.