-
Bug
-
Resolution: Done
-
Major
-
1.7.5.SP1.GA
-
False
-
False
-
+
-
Undefined
-
-
-
---
-
As mentioned in the guide, quarkus-narayana-jta extension provides javax.transaction.TransactionScoped support.
However, even if quarkus-narayana-jta extension is enabled, @PreDestory method is not invoked for @TransactionScoped bean at the end of the transaction (commit or rollback). (@PostConstruct method is invoked correctly, though.)
import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.transaction.TransactionScoped; import org.jboss.logging.Logger; @TransactionScoped public class ExampleTransactionalScopeBean implements ExampleTransactionalScope { private static final long serialVersionUID = 1L; private static final Logger log = Logger.getLogger(ExampleTransactionalScopeBean.class); private long value; @PostConstruct void init() { this.value = System.currentTimeMillis(); log.infof("ExampleTransactionalScopeBean initialized. bean value is %s", this.value); } @PreDestroy void destroy() { log.infof("ExampleTransactionalScopeBean destroyed. bean value is %s", this.value); } public long getValue() { log.infof("ExampleTransactionalScopeBean value = %s", this.value); return value; } }
- relates to
-
JBTM-1983 JTA 1.2 @TransactionScoped Context doesn't call @Predestroy on TransactionScoped Beans
- Closed