Hi Pinaki,
The property in number 3 resolved everything now it works fine.
I really appreciate your effort on this and thank you Pinaki and Miłosz for
spending your valuable time to help me
Pinaki Poddar wrote:
>
> Hi,
> Looks like the lookup had found something within GlassFish.
>
> You can try other variants as follows:
> Just to cross-check, here are some relevant config
>
> 1. <persistence-unit name="JPXA" transation-type="JTA">
>
> 2. <property name="openjpa.TransactionMode" value="managed"/>
>
> You can try a plug-in string to lookup the TM in JNDI (the value is the
> JNDI name of GlassFish TM as per Google search)
> 3. <property name="openjpa.ManagedRuntime"
>
> value="jndi(TransactionManagerName=java:appserver/TransactionManager)"/>
>
> Also check the value of configuration.getConnectionRetainMode() that
> controls whether the database connection will be released after completion
> or not.
>
>
>
> is_maximum wrote:
>>
>> Hi Pinaki,
>> I did the code you sent and the returned value is an instance of
>> following class:
>> org.apache.openjpa.ee.RegistryManagedRuntime$TransactionManagerRegistryFacade
>>
>> in which a property of type:
>> _registry =
>> com.sun.enterprise.distributedtx.TransactionSynchronizationRegistryImpl
>>
>> is existed.
>>
>> Does it mean that our config are correctly set?
>>
>> thanks
>>
>>
>> Pinaki Poddar wrote:
>>>
>>> Hi,
>>> I had presumed that you had configured OpenJPA for XATransaction with
>>> correct configuration as Milosz points out. To verify that OpenJPA is
>>> configured correctly to relinquish its transaction management to a
>>> external transaction manager, do the following on the injected
>>> EntityManager:
>>>
>>> OpenJPAPersistence.cast(em).getConfiguration()
>>> .getManagedRuntimeInstance()
>>> .getTransactionManager();
>>>
>>> That should indicate whether OpenJPA configuration correctly
>>> identified the external TM.
>>>
>>>
>>>
>>>
>>> Miłosz Tylenda wrote:
>>>>
>>>> Mohammad,
>>>>
>>>> There are a couple of notes on XA transactions in the user manual [1].
>>>> Have you tried them?
>>>>
>>>> The javadoc of AutomaticManagedRuntime [2] mentions SunONE as supported
>>>> out-of-the-box but not GlassFish, so you might need to provide your own
>>>> glue code.
>>>>
>>>> Regards,
>>>> Milosz
>>>>
>>>> [1]
>>>> http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_enterprise_trans
>>>> [2]
>>>> http://openjpa.apache.org/builds/latest/docs/javadoc/org/apache/openjpa/ee/AutomaticManagedRuntime.html
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
-----
--
Regards
Mohammad
http://pixelshot.wordpress.com Pixelshot
--
View this message in context: http://n2.nabble.com/EntityManager-dosn-t-release-connection-in-XA-transactions-tp4205041p4213546.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
|