I was creating a native query from a persistence EntityManager to perform an update.
Query query = entityManager.createNativeQuery(queryString);
I was receiving the following error:
caused by: javax.persistence.TransactionRequiredException: Executing an update/delete query
Many solutions suggest adding @Transactional to your method. Just doing this did not change the error.
I then tried use of application managed entity managers and not container managed and that was joinTransaction().
Kept @Transactional for decorating the method and then called joinTransaction() on EntityManager object just prior to calling query.executeUpdate() and my native query update worked.