@Predestroy method in @TransactionScoped bean is not called back at the end of the transaction in Quarkus 1.7.x

Solution Verified - Updated -

Issue

@PreDestroy method in @TransactionScoped bean is not called back when the JTA transaction is committed or rolled back.

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.transaction.TransactionScoped;

@TransactionScoped
public class ExampleTransactionalScopeBean implements ExampleTransactionalScope {

    @PostConstruct
    void init() {
        ...
    }

    @PreDestroy
    void destroy() {
        // issue: this method is not called back when the JTA transaction is committed or rolled back.
    }
}

Environment

  • Red Hat Build of Quarkus (RHBQ)
    • 1.7.x

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