val breakdownDimensions = transaction {
Dimension.find {
Dimensions.id inList breakdownIds
}
}
for (dimension in breakdownDimensions) {
println(dimension.id)
}
e
Endre Deak
03/26/2021, 3:40 PM
did you wrap this into
transaction { }
?
j
John Pena
03/26/2021, 3:41 PM
there’s a transaction in the code i posted
John Pena
03/26/2021, 5:44 PM
i’m not entirely clear on what the issue was, but wrapping all of the code that uses my database types in a transaction did fix my problem
e
Endre Deak
03/26/2021, 9:44 PM
yeah in order to be able to use them, you must be inside a transaction
j
Joel
03/29/2021, 7:13 PM
@John Pena I believe
Dimension.find
returns a
SizedIterable
which hasn't actually queried yet. The reason is that you could be asking for count, or existence, something that doesn't require the query to be completed in full. The query is actually occurring when you access the iterator using