Using Transaction in PostConstruct
I'm using Hibernate with Panache and I need to add a user when the application starts.
For that, I'm annotating my bean with @Startup and then I have a method with the annotation @PostConstruct.
Currently, I'm using the following code:
@Startup
@ApplicationScoped
class AuthService {
@Inject
lateinit var userRepository: UserRepository
@PostConstruct
private fun init() {
logger.info("Creating admin user")
val user = User(
"Admin", ADMIN_NAME,...