https://kotlinlang.org logo
#exposed
Title
# exposed
d

Dominick

04/28/2021, 3:24 AM
Do I need to call Database.connect(dataSource) every time I create a transaction? I'm receiving errors and I'm kind of confused because I do call it after I create the datasource
It says there:
Note: Starting Exposed 0.10 executing this code more than once per db will create leaks in your application, hence it is recommended to store it for later use. For example:
object DbSettings {
val db by lazy {
Database.connect(/* setup connection */)
}
}
3 Views