geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guglielmo.Licht...@instinet.com
Subject Re: Enlisting XAResource objects
Date Wed, 23 Nov 2005 21:36:54 GMT
The XAResource in question is a XA-capable write-back cache. So the 
connection metaphor
is not such a good fit - that's why I am asking the question.

I would prefer to just grab a reference to the transaction manager gbean, 
which implements

javax.transaction.TransactionManager

and call

getTransaction().enlistResource(..)

If I go with this solution, how to get a reference to the the transaction 
manager gbean?

Alternatively, I see the method watchResourceManagers here:

http://svn.apache.org/repos/asf/geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/TransactionManagerImplGBean.java

How would I write a gbean which ends up in this collection? Come to think 
of it, this may be the way to go
because I see that that will cause XAResource.recover() to be invoked 
first.





David Jencks <david_jencks@yahoo.com>
11/23/2005 12:10 PM
Please respond to user

 
        To:     user@geronimo.apache.org
        cc: 
        Subject:        Re: Enlisting XAResource objects



On Nov 23, 2005, at 11:54 AM, Guglielmo.Lichtner@instinet.com wrote:

>
> I have a home-grown resource manager (XAResource implementation) which 
> I would like enlist in a transaction.
> I see two ways of doing this:
>
> 1) Write a JCA resource adapter, since the app server has to enlist 
> the xa resource for the connection.
>
> 2) Create a geronimo "configuration" which has a reference to the 
> transaction manager gbean, then grab
> the javax.transaction.Transaction object from that and call the 
> enlist- method.
>
> Does anybody care to comment on 1 vs. 2 ?

It's hard to judge without knowing more about what your RM actually 
does.  If it has anything resembling connections that would be helped 
with a connection pool, I would strongly recommend writing a resource 
adapter.  Its pretty easy, you can base it on tranql-connector code, 
etc etc and it will save you a lot of work trying to relate to the TM 
properly.  If it really doesn't have anything like connections, then I 
don't think it makes sense to write a RA.  In this case before I start 
giving advice I'd like to know more about how your application gets in 
touch with the RM and tells it to do something and how you envisage 
enlist/delist to work.

thanks
david jencks






*****************************************************************
<<<Disclaimer>>>

In compliance with applicable rules and regulations, Instinet
reviews and archives incoming and outgoing email communications,
copies of which may be produced at the request of regulators.
This message is intended only for the personal and confidential
use of the recipients named above.  If the reader of this email
is not the intended recipient, you have received this email in
error and any review, dissemination, distribution or copying is
strictly prohibited. If you have received this email in error,
please notify the sender immediately by return email and
permanently delete the copy you received.  

Instinet accepts no liability for any content contained in the
email, or any errors or omissions arising as a result of email
transmission. Any opinions contained in this email constitute
the sender's best judgment at this time and are subject to change
without notice.   Instinet does not make recommendations of a
particular security and the information contained in this email
should not be considered as a recommendation, an offer or a
solicitation of an offer to buy and sell securities.

*****************************************************************


Mime
View raw message