Hi all I was trying to upgrade exposed from `0.21....
# exposed
a
Hi all I was trying to upgrade exposed from
0.21.1
to
0.25.1
. However, the code that previously successfully connected is now throwing this error after upgrading:
Copy code
Error Message: java.lang.IllegalStateException: Please call Database.connect() before using this code
        Stacktrace: 
        org.jetbrains.exposed.sql.transactions.NotInitializedManager.currentOrNull(TransactionApi.kt:38)
        org.jetbrains.exposed.sql.transactions.TransactionManager$Companion.currentOrNull(TransactionApi.kt:90)
        org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$transaction$1.invoke(ThreadLocalTransactionManager.kt:114)
        org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:212)
        org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:113)
        org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:111)
        org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction$default(ThreadLocalTransactionManager.kt:110)
Has anyone else experienced this problem and knows how to solve it? We do call
Database.connect(...)
before we call
transaction {
. We are also using
org.postgresql:postgresql:42.2.9