Unless I'm missing something it appears that you can make JOOQ and JPA 
coexist with @Transactional if you make the following changes to the 
example in GitHUB.

Here's the example 
code: 
https://github.com/jOOQ/jOOQ/tree/master/jOOQ-examples/jOOQ-spring-boot-example/src/main/java/org/jooq/example/spring

1. In SpringTransactionProvider.java change the injected tx from 
DataSourceTransactionManager to PlatformTransactionManager (it's the 
interface DataSourceTransactionManager implements).
2. In Application.java replace the following method:

@Bean
public DataSourceTransactionManager transactionManager(DataSource 
dataSource) {
    return new DataSourceTransactionManager(dataSource);
}


With:

@Bean
public PlatformTransactionManager transactionManager() {
     return new JpaTransactionManager(entityManagerFactory().getObject());
}


The EntityManagerFactory should already be defined in your config. That's 
pretty much it. Since the EntityManager has your dataSource already it 
should allow the two to coexist with transactions. 

This should make it easier to migrate from JPA to JOOQ incrementally.

Let me know if I've missed anything. 

R.


-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to