You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
val result = transaction {
ServerRow.findById(server.id)!!.load(ServerRow::owner)
}
println(result.owner.lokin)
ServerRow
classServerRow(id:EntityID<UUID>) : UUIDEntity(id) {
companionobject:UUIDEntityClass<ServerRow>(ServersTable)
var name by ServersTable.name
var description by ServersTable.description
var members by UserRow via MembersTablevar owner by UserRow referencedOn ServersTable.owner // Here is errorval groups by GroupRow referrersOn GroupsTable.server
val roles by RoleRow referrersOn RolesTable.server
var createdAt by ServersTable.createdAt
}
UserRow
classUserRow(id:EntityID<UUID>) : UUIDEntity(id) {
companionobject:UUIDEntityClass<UserRow>(UsersTable)
var lokin by UsersTable.lokin
var password by UsersTable.password
var username by UsersTable.username
var region by UsersTable.locale
var registeredAt by UsersTable.registeredAt
var accessLevel by UsersTable.accessLevel
var isBanned by UsersTable.isBanned
}
Error:
java.lang.IllegalStateException: Can't init value outside the transaction
at org.jetbrains.exposed.sql.transactions.TransactionStore.getValue(TransactionScope.kt:21)
at org.jetbrains.exposed.dao.EntityLifecycleInterceptorKt.isExecutedWithinEntityLifecycle(EntityLifecycleInterceptor.kt:12)
at org.jetbrains.exposed.dao.EntityLifecycleInterceptorKt.executeAsPartOfEntityLifecycle(EntityLifecycleInterceptor.kt:15)
at org.jetbrains.exposed.dao.Entity.getValue(Entity.kt:96)
at run.flake.entities.database.ServerRow.getOwner(Servers.kt:29)
at run.flake.routes.user_api.ServersRouteKt$servers$1$2.invokeSuspend(ServersRoute.kt:72)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:138)
at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:112)
at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:14)
at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:62)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.UndispatchedCoroutine.afterResume(CoroutineContext.kt:233)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at io.netty.util.concurrent.AbstractEventExecutor.runTask$$$capture(AbstractEventExecutor.java:174)
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:167)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:503)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.ktor.server.netty.EventLoopGroupProxy$Companion.create$lambda-1$lambda-0(NettyApplicationEngine.kt:260)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)
The text was updated successfully, but these errors were encountered:
ServerRow
UserRow
Error:
The text was updated successfully, but these errors were encountered: