-
-
Save theboreddev/ee9264c6c2879ab6889e632805119776 to your computer and use it in GitHub Desktop.
With transaction support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun create(user: User): User { | |
return withinTransaction { | |
val savedUser = userRepository.save(user) | |
eventsEngine.send(UserCreated(UUID.randomUUID().toString(), user)) | |
User.create(savedUser) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment