Slide 35
Slide 35 text
Exposed SQL DSL
In Virtual Threads
@Test
fun `get all actors in multiple virtual threads`() {
VirtualthreadTester()
.numThreads(Runtimex.availableProcessors * 2)
.roundsPerThread(4)
.add {
transaction(db) {
val actors = Actors.selectAll().map { it.toActorDTO() }
actors.shouldNotBeEmpty()
}
}
.run()
}
fun `get all actors in virtual threads`() {
virtualFuture {
transaction {
val actors = Actors.selectAll().map { it.toActorDTO() }
actors.shouldNotBeEmpty()
}
}.await()
}
2025-02-09 00:27:53.688 DEBUG 78219 --- [ bluetape4k-test-vt-2] Exposed : SELECT ACTORS.ID, ACTORS.FIRST_NAME, ACTORS.LAST_NAME, ACTORS.DATE_OF_BIRTH FROM ACTORS
2025-02-09 00:27:53.688 DEBUG 78219 --- [ bluetape4k-test-vt-1] Exposed : SELECT ACTORS.ID, ACTORS.FIRST_NAME, ACTORS.LAST_NAME, ACTORS.DATE_OF_BIRTH FROM ACTORS
2025-02-09 00:27:53.688 DEBUG 78219 --- [ bluetape4k-test-vt-5] Exposed : SELECT ACTORS.ID, ACTORS.FIRST_NAME, ACTORS.LAST_NAME, ACTORS.DATE_OF_BIRTH FROM ACTORS
2025-02-09 00:27:53.689 DEBUG 78219 --- [ bluetape4k-test-vt-3] Exposed : SELECT ACTORS.ID, ACTORS.FIRST_NAME, ACTORS.LAST_NAME, ACTORS.DATE_OF_BIRTH FROM ACTORS
2025-02-09 00:27:53.689 DEBUG 78219 --- [ bluetape4k-test-vt-0] Exposed : SELECT ACTORS.ID, ACTORS.FIRST_NAME, ACTORS.LAST_NAME, ACTORS.DATE_OF_BIRTH FROM ACTORS