IIRC correctly, the reason the platform added the TransactionSynchronizationRegistry
was so that access to the TransactionManager wouldn't be needed. This issue was discussed
in the Java EE 5 expert group, where there was some strong opposition to exposing
the TransactionManager itself-- which led to the introduction of TransactionSynchronizationRegistry.
Why isn't this sufficient?
On 10/28/2011 2:33 PM, Scott Marlow wrote:
> On 10/28/2011 01:57 PM, Linda DeMichiel wrote:
>> The Java EE platform requires that the
>> TransactionSynchronizationRegistry be made
>> available through JNDI (or by injection). Doesn't this work? See section
>> EE.5.11.
>
> Good point, the TransactionSynchronizationRegistry could be looked up via JNDI.
>
> I think passing the TransactionManager JNDI name (or instance), to the persistence provider would still be helpful, to
> eliminate the application server specific code for obtaining the TransactionManager.
>
>>
>> -Linda
>>
>> On 10/28/2011 6:33 AM, Scott Marlow wrote:
>>> Recently, I have been spending a lot of time on the JBoss AS JPA
>>> container and its integration with persistence
>>> providers using the JPA SPIs. I think we have some low hanging fruit
>>> to be had, in standardizing how the persistence
>>> providers obtain a JTA transaction manager.
>>>
>>> I've looked at (mostly four) different persistence providers and how
>>> they have application server vendor (often version)
>>> specific integration for obtaining either the JTA TransactionManager
>>> or TransactionSynchronizationRegistry.
>>>
>>> To improve how persistence providers integrate with containers, I
>>> think we should introduce properties for the container
>>> to pass a TM/TSR reference to the provider. This will help reduce the
>>> amount of application server vendor specific code,
>>> needed by the different persistence providers.
>>>
>>> Perhaps the properties could be:
>>>
>>> javax.persistence.transactionmanager - JNDI name of JTA Transaction
>>> Manager or instance of JTA Transaction Manager
>>>
>>> javax.persistence.transactionsynchronization - JNDI name of
>>> TransactionSynchronizationRegistry or instance of
>>> TransactionSynchronizationRegistry.
>>>
>>> The idea being that providers should expect either a TM/TSR to be
>>> passed directly or to use a JNDI lookup name (so
>>> providers could work with EE servers that don't have a single TSR/TM
>>> to pass in but perhaps have several instances to
>>> choose from).
>>>
>>> What do you think?
>>>
>>> Scott
>