use of io.micronaut.transaction.support.DefaultTransactionDefinition in project micronaut-test by micronaut-projects.
the class JpaNoRollbackTest method cleanup.
@AfterAll
void cleanup() {
final TransactionStatus tx = transactionManager.getTransaction(new DefaultTransactionDefinition());
final CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
final CriteriaDelete<Book> delete = criteriaBuilder.createCriteriaDelete(Book.class);
delete.from(Book.class);
entityManager.createQuery(delete).executeUpdate();
transactionManager.commit(tx);
}
use of io.micronaut.transaction.support.DefaultTransactionDefinition in project micronaut-sql by micronaut-projects.
the class MicronautDataTransactionHandler method begin.
@Override
public void begin(Handle handle) {
TransactionDefinition definition = new DefaultTransactionDefinition(TransactionDefinition.Propagation.NESTED);
TransactionStatus<Connection> status = this.transactionManager.getTransaction(definition);
this.localTransactions.putIfAbsent(handle, new LocalStuff(status));
}
Aggregations