tx.setRollbackOnly() in PersistentInterceptor.beforeTransactionCompletion() method does not work as expected on spring boot runtime

Solution Verified - Updated -

Issue

tx.setRollbackOnly() in PersistentInterceptor.beforeTransactionCompletion() method does not work as expected on spring boot runtime.

    @Override
    public void beforeTransactionCompletion(Transaction tx) {
            tx.setRollbackOnly();
    }

The debug level log says there is no active transaction.

20:15:26.769 [main] DEBUG o.h.e.t.internal.TransactionImpl - #setRollbackOnly called on a not-active transaction

Environment

  • Red Hat Fuse
    • 7.8

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content