Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jta-dev] Enhancement of the @Transactional Annotation

On Tue, 6 Dec 2022 at 10:59, Benedict Eisenkrämer <benedict@xxxxxxxxxxxxxx> wrote:

I think timeout and readOnly should be more straight forward:

For timeout the XAResource Interface provides a way to set it: It seems to be a optional feature of the underlying ResourceManager, so it would be nice to maybe log a warning in that.

For readOnly the main benefit is in what the specific implementaion makes of it (i.a. optimizations, as pointed out by Christian). I think the only requirement should be, that no entities may be updated, created or deleted. That way no work should be enlisted and the transaction can be commited as readonly.

For Isolation-Levels:

I do not 100% understand how the internals of the Transactional Implementation(s) work, but from my naive standpoint shouldn't it be possible to somehow acquire the currently used java.sql.Connection and just do something like this:


As under the hood surely jdbc is used as well, or am I wrong here?

Jakarta Transactions can coordinate more than just JDBC connections though, for example XAResources from a Jakarta Messaging implementation. And I don't think that isolation levels and readonly are something that can be relied upon to be facilities offered by every resource manager that can provide an XAResource.  

On 06.12.22 10:45, Tom Jenkinson wrote:
Thank you for raising the topic!

I think an important consideration when adding things to Jakarta Transactions is what can the XAResource API support?

Rearding isolation levels, I don't think we have a way to inform the XAResource of isolation level and so adding that something like that to Jakarta Transactions it is not clear to me what an implementation would do with that information? Reading it seems intended to be specific to JDBC and so it seems maybe Spring has a way to merge a concept of datasource with their Transactional annotation? I am not sure the same would be appropriate for Jakarta Transactions.

On Sun, 4 Dec 2022 at 15:44, Benedict Eisenkrämer <benedict@xxxxxxxxxxxxxx> wrote:

Hello there,

I am new to this mailing list so maybe a few short words to myself first: I am a Software Engineer in Germany responsible for our JavaEE, soon to be JakartaEE framework. I am quiet interested in  JakartaEE and its development.

The topic I would like to discuss is the enhancement of the @Transactional Annotation for JakartaEE 11. A good template would be the Spring specific Annotation of the same name which supports among other things :

  • Isolation levels
  • timeout
  • readOnly

I already found a issue on github regarding the Topic, which unfortunately has not seen any attention given to it since 2016. So I wanted to spark a discussion.

In my opinion these enhancement could be quiet helpful.

Thanks in advance and best regards

Benedict Eisenkrämer

jta-dev mailing list
To unsubscribe from this list, visit

jta-dev mailing list
To unsubscribe from this list, visit
jta-dev mailing list
To unsubscribe from this list, visit

Back to the top