Hi <@U0EC2UPDF> why I can't access the values from...
# exposed
s
Hi @tapac why I can't access the values from my DAO outside a transaction? I'm getting a exception when a try to access
Copy code
java.lang.IllegalStateException: No transaction in context.
    at org.jetbrains.exposed.sql.transactions.TransactionManager$Companion.current(TransactionApi.kt:92) ~[nations-spigot-0.1.0-SNAPSHOT-all.jar:?]
    at org.jetbrains.exposed.dao.EntityClass.warmCache(EntityClass.kt:24) ~[nations-spigot-0.1.0-SNAPSHOT-all.jar:?]
    at org.jetbrains.exposed.dao.EntityClass.testCache(EntityClass.kt:73) ~[nations-spigot-0.1.0-SNAPSHOT-all.jar:?]
    at org.jetbrains.exposed.dao.EntityClass.findById(EntityClass.kt:42) ~[nations-spigot-0.1.0-SNAPSHOT-all.jar:?]
    at org.jetbrains.exposed.dao.EntityClass.findById(EntityClass.kt:33) ~[nations-spigot-0.1.0-SNAPSHOT-all.jar:?]
    at org.jetbrains.exposed.dao.Entity.getValue(Entity.kt:55) ~[nations-spigot-0.1.0-SNAPSHOT-all.jar:?]
    at com.zentrymc.nationsapi.database.tables.Account.getSettings(Accounts.kt) ~[nations-spigot-0.1.0-SNAPSHOT-all.jar:?]
t
All references are bound to transaction, you could not access related entries outside of it.
s
Sad to hear, in this case I will need to create a DTO just for that :S