Hello. Should all the examples on this page be ins...
# exposed
a
Hello. Should all the examples on this page be inside a
transaction { }
block? https://github.com/JetBrains/Exposed/wiki/DSL
j
Short answer: yes. Long answer: there has to be a transaction in context somehow. If your caller started the transaction, you don't have to wrap your code in yet another transaction. You're good as long as you're within a transaction block somewhere up the stack.
a
Thanks! Will investigate more
Turns out it is happening automagically on this project because it’s using Spring Boot, which wires things up automagically (via
exposed-spring-boot-starter
) and Spring’s
@Transactional
annotation.