Hi, 
      I've got a spring4+jooq application, based on jOOQ-spring-boot-example
/
I would like to use *PROPAGATION_REQUIRES_NEW* in a method called inside 
another transactional (to obtain and indipendent transaction) method
marked as *PROPAGATION_REQUIRES* that is default.
Should it work in your example project? 
It seems to me that it doens't work cause my transactionProvider define 
"statically" the default behavior as PROPAGATION_REQUIRES
and when it change on @Transactional annotation is doesn't take effect. Is 
it possible?

This is my provider.

public class SpringTransactionProvider implements TransactionProvider {

        private static final JooqLogger log = 
JooqLogger.getLogger(SpringTransactionProvider.class);

        @Autowired DataSourceTransactionManager txMgr;

        @Override
        public void begin(TransactionContext ctx) {
                log.info("Begin transaction");

                // This TransactionProvider behaves like jOOQ's 
DefaultTransactionProvider,
                // which supports nested transactions using Savepoints
                // but use PROPAGATION_REQUIRED AS DEFAULT
                TransactionStatus tx = txMgr.getTransaction(new 
DefaultTransactionDefinition(PROPAGATION_REQUIRED));
                ctx.transaction(new SpringTransaction(tx));
        }

        @Override
        public void commit(TransactionContext ctx) {
                log.info("commit transaction");
                txMgr.commit(((SpringTransaction) ctx.transaction()).tx);
        }

        @Override
        public void rollback(TransactionContext ctx) {
                log.info("rollback transaction");
                txMgr.rollback(((SpringTransaction) ctx.transaction()).tx);
        }}

-- 
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