我正在尝试创建表(postgres + 暴露 + ktor + JDBC),我得到了那个错误。
在下面找到我的配置:
构建.gradle
compile group: 'postgresql', name: 'postgresql', version: '9.0-801.jdbc4'
你好.kt
object Pays : Table() {
val id = integer("id").autoIncrement().primaryKey() // Column
val name = varchar("name", 50) // Column
}
fun main(args: Array) {
Database.connect("jdbc:postgresql://localhost/my_db", driver = "org.postgresql.Driver", user = "user", password = "password")
这是我遇到的错误
Caused by: org.postgresql.util.PSQLException: Transaction isolation level 4 not supported.
at org.postgresql.jdbc2.AbstractJdbc2Connection.setTransactionIsolation(AbstractJdbc2Connection.java:826)
at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManager$ThreadLocalTransaction$connectionLazy$1.invoke(ThreadLocalTransactionManager.kt:25)
at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManager$ThreadLocalTransaction$connectionLazy$1.invoke(ThreadLocalTransactionManager.kt:20)
at kotlin.UnsafeLazyImpl.getValue(Lazy.kt:154)
at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManager$ThreadLocalTransaction.getConnection(ThreadLocalTransactionManager.kt:29)
at org.jetbrains.exposed.sql.Transaction.getConnection(Transaction.kt)
at org.jetbrains.exposed.sql.Database.getMetadata$exposed(Database.kt:17)
at org.jetbrains.exposed.sql.Database$url$2.invoke(Database.kt:26)
at org.jetbrains.exposed.sql.Database$url$2.invoke(Database.kt:15)
at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:131)
at org.jetbrains.exposed.sql.Database.getUrl(Database.kt)
at org.jetbrains.exposed.sql.Database$dialect$2.invoke(Database.kt:29)
at org.jetbrains.exposed.sql.Database$dialect$2.invoke(Database.kt:15)
at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:131)
at org.jetbrains.exposed.sql.Database.getDialect$exposed(Database.kt)
at org.jetbrains.exposed.sql.vendors.DefaultKt.getCurrentDialect(Default.kt:319)
at org.jetbrains.exposed.sql.vendors.DefaultKt.getCurrentDialectIfAvailable(Default.kt:323)
at org.jetbrains.exposed.sql.Column.getOnDelete$exposed(Column.kt:14)