You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Claudio Corsi <cc...@progress.com> on 2006/02/16 17:42:24 UTC

How can I get a reference to Geronimo TransactionManager instance...

Hi all,

I was wondering if you have a standard process to get an instance of 
Geronimo TransactionManager instance?

I have been trying to understand your use of the gbean package and it is 
not readily clear how I can get an instance of the TransactionManager 
and/or TransactionContextManager instance.

thanks,

--Claudio

Re: How can I get a reference to Geronimo TransactionManager instance...

Posted by David Jencks <da...@yahoo.com>.
On Feb 16, 2006, at 9:30 AM, Claudio Corsi wrote:

>
>
> David Jencks wrote:
>
>> On Feb 16, 2006, at 8:42 AM, Claudio Corsi wrote:
>>> Hi all,
>>>
>>> I was wondering if you have a standard process to get an  
>>> instance  of Geronimo TransactionManager instance?
>>>
>>> I have been trying to understand your use of the gbean package  
>>> and  it is not readily clear how I can get an instance of the   
>>> TransactionManager and/or TransactionContextManager instance.
>> Knowing what kind of component needs the TM or TCM would be a  
>> help.   One way for a non-geronimo-aware component to use the TCM  
>> is  demonstrated in the spring tm in the spring module in trunk.
>
> Hi Dave,
>
> Thanks for the reply.
>
> The problem is that I will not know a priori which component is  
> using the TM/TCM.
>
> Let me describe our product. We have a product called ObjectStore  
> JMTL. This product has the ability to implicitly enlist itself as  
> an XAResource with any jta aware app. The way that we implement  
> this feature is by getting a reference to a TM and using this  
> instance to get the current TXN to enlist ourselves. This work is  
> jta implementation specific since there is no standard way to  
> access a TM.
>
> Our reason for implementing this was so that our users do not need  
> to explicitly enlist themselves.
>
> I've looked at the STM implementation and it still requires a TCM  
> name. The question is if this name is unique per application server  
> instance? If it is, how can I get a reference to that unique name?  
> If it is not, how can I determine which one is currently be used?

We need a easier way for non-geronimo stuff to access our components :-)

You should be able to get the TCM name using a GBeanQuery like this:

List names = kernel.listGBeans(new GBeanQuery(null,  
TransactionContextManager.class.getName()));

This ought to have only one name in it.  I should change the STM to  
use this.

In order to participate in recovery, your XAResource has to actually  
implement NamedXAResource and supply a name that will be the same  
each time your component instance starts.

Usually to start a service in geronimo it is easiest to wrap it in a  
gbean.  If you do this you can more easily get the TCM by simply  
having a gbean reference  to it.

thanks
david jencks



>
> thanks,
>
> --Claudio
>
>> thanks
>> david jencks
>>>
>>> thanks,
>>>
>>> --Claudio


Re: How can I get a reference to Geronimo TransactionManager instance...

Posted by Claudio Corsi <cc...@progress.com>.

David Jencks wrote:

> 
> On Feb 16, 2006, at 8:42 AM, Claudio Corsi wrote:
> 
>> Hi all,
>>
>> I was wondering if you have a standard process to get an instance  of 
>> Geronimo TransactionManager instance?
>>
>> I have been trying to understand your use of the gbean package and  it 
>> is not readily clear how I can get an instance of the  
>> TransactionManager and/or TransactionContextManager instance.
> 
> 
> Knowing what kind of component needs the TM or TCM would be a help.   
> One way for a non-geronimo-aware component to use the TCM is  
> demonstrated in the spring tm in the spring module in trunk.
> 

Hi Dave,

Thanks for the reply.

The problem is that I will not know a priori which component is using 
the TM/TCM.

Let me describe our product. We have a product called ObjectStore JMTL. 
This product has the ability to implicitly enlist itself as an 
XAResource with any jta aware app. The way that we implement this 
feature is by getting a reference to a TM and using this instance to get 
the current TXN to enlist ourselves. This work is jta implementation 
specific since there is no standard way to access a TM.

Our reason for implementing this was so that our users do not need to 
explicitly enlist themselves.

I've looked at the STM implementation and it still requires a TCM name. 
The question is if this name is unique per application server instance? 
If it is, how can I get a reference to that unique name? If it is not, 
how can I determine which one is currently be used?

thanks,

--Claudio

> thanks
> david jencks
> 
>>
>> thanks,
>>
>> --Claudio
> 
> 

Re: How can I get a reference to Geronimo TransactionManager instance...

Posted by David Jencks <da...@yahoo.com>.
On Feb 16, 2006, at 8:42 AM, Claudio Corsi wrote:

> Hi all,
>
> I was wondering if you have a standard process to get an instance  
> of Geronimo TransactionManager instance?
>
> I have been trying to understand your use of the gbean package and  
> it is not readily clear how I can get an instance of the  
> TransactionManager and/or TransactionContextManager instance.

Knowing what kind of component needs the TM or TCM would be a help.   
One way for a non-geronimo-aware component to use the TCM is  
demonstrated in the spring tm in the spring module in trunk.

thanks
david jencks

>
> thanks,
>
> --Claudio