-1

I would like to integrate Kotlin Exposed into a Kotlin application that is already using Spring Data JPA. The problem I have is that only want to use one Transaction Manager for my application, but currently I have to have two (one for JPA and another for Exposed). Is there a way to only have one Transaction Manager?

1 Answers1

0

I didn't work with kotlin-exposed library before, but based on your question ,Just you have to create your own transaction-manager bean. After that spring will use your bean, and you need to configure kotlin-exposed to use it. sample:

    @Primary
    @Bean("appTransactionManager")
    fun appTransactionManager(
            @Qualifier("appEntityManagerFactory") appEntityManagerFactory: LocalContainerEntityManagerFactoryBean
    ): PlatformTransactionManager {
        return JpaTransactionManager(eccTransactionManager.getObject()!!)
    }
Ibrahim AlTamimi
  • 624
  • 5
  • 15