Say I use both Hibernate (JPA) and jOOQ for my data persistence.
I want to open transaction via EntityManager to do some work.
Then I use jOOQ for selecting and updating few tables in the same transaction that I opened with EntityManager, and I commit or roll back all the operations above.
I don't use Spring or any other container transaction manager.
try {
entityManager.getTransaction().begin();
//do JPA stuff here fetch from FB update entity
DLSConext - want to use JOOQ DSL for crud operation
em.getTransaction().commit()
} catch (Exception e) {
em.getTransaction().rollback(); //All Hibernate and jooq operation should rool back
}
Edit So How do I do it? Say for example I using jOOQ for some updates and I then I want Hibernate to find an entity, but I also want Hibernate to see the updates done by jOOQ few lines before fetching an entity.