Hi, Bernd,
I replied on the Quarkus issue
https://github.com/quarkusio/quarkus/issues/34569 with more details, including how to create a custom @MyTransactional annotation with the default behavior to roll back on any transaction. I also mentioned there that it's already possible to change the default behavior by a CDI extension. These approaches are just not known by the majority of Java developers because Spring took over and nobody learns Jakarta EE in more detail beyond simple examples. Spring seems to have a specific config option or a class for almost every usecase, while Jakarta EE aims at having minimal API but endless possibilities of composing API components.
Where Jakarta EE is lacking is the documentation, more complex examples, and description of common usecases that can be addressed by a combination of Jakarta EE components. The newer parts of Jakarta EE, which are based on CDI, are brilliant in connecting different features and combining them together. Many common usecases are easily supported by a combination of Jakarta EE features, like in this case @Transactional combined with stereotype or CDI extension, but it's not always evident how to combine them. For experts in Jakarta EE it all makes sense because things just click, for newcomers it's not easy because these combinations are not documented and they often don't know about the possibilities until they study a lot more.
Can we add support in JTA to globally switch the default behavior of @Transactional? Definitely.
Is it necessary? Not really, because there are already ways to do it pretty easily.
Is it easy to find out how to do it? Often not, and that's where Jakarta EE should improve. The specs like JTA could already describe some common usecases and provide examples. The official Jakarta Tutorial (
https://jakarta.ee/learn) could cover these usecases. But, in the end, it's always about whether anybody has time to do it. If you and the Quarkus community could, for example, review the Jakarta Tutorial, and contribute improvements or at least raise issues to address, then we can greatly improve the situation together.
All the best,Ondro Mihalyi
Director, Jakarta EE expert
Omnifish OÜ, Narva mnt 5, 10117 Tallinn, Estonia | VAT: EE102487932