use of io.micronaut.transaction.TransactionStatus 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);
}
Aggregations