geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <djen...@gluecode.com>
Subject Re: Integration of Geronimo modules (Tx / JCA) in Spring
Date Fri, 27 May 2005 17:11:06 GMT
I'm not entirely sure what you are asking.  Neither tranql nor anyone  
else has any magic xa elixir to wrap a non-xa database and make it have  
xa semantics.  However, you can deploy local-transaction only resource  
adapters in geronimo and have them participate in JTA transactions.   
Geronimo won't complain, but you wont get xa semantics if you have more  
than one transaction participant.  The standard tranql connector wraps  
a Driver implementation into a local-transaction only resource adapter.  
  If you have a database that really implements XADataSource, you can  
easily extend the tranql connector to a xa-transaction resource  
adapter.  The easiest way to do this is probably to copy the  
derby-connector and modify it.

Hope this helps
david jencks

On May 27, 2005, at 4:27 AM, Thierry Templier wrote:

> Thanks a lot David! Your answer helps me a lot...
> I'm working on the application to use TM and connector
> modules without the entire Geronimo server.
> I'm using Tranql to configure datasource. I see that
> tranql connector doesn't support XA transactions
> according to the ra.xml file... Is it possible to
> create a datasource that supports XA transactions with
> Tranql basing a non XA JDBC driver?
> Thanks for your help.
> Thierry
>
>> NPE -- see my explanation in my first reply, and ask
>> more specific
>> questions if what I wrote is incomprehensible :-)
>>
>> TM initialization -- you should use the up to date
>> code :-)
>>
>> Hmm. looking at this a bit I see we are using the
>> geronimo kernel
>> automatic collection management to register the
>> resource managers with
>> the tm.  What kind of environment are you targeting?
>>  Is this a static
>> environment intended to run a single application,
>> and restarted
>> whenever anything changes, or is it an environment
>> in which jca
>> adapters/resource managers will be deployed and
>> undeployed dynamically
>> while the container is running?  With the current
>> implementation you
>> will need to figure out a way to implement
>> ReferenceCollection so you
>> can add all the jca adapters to it... or if you
>> aren't interested in
>> recovery just implement an empty
>> ReferenceCollection.
>>
>> ReferenceCollection resourceManagers = ??//don't
>> know what you want to
>> do here
>> TransactionLog transactionLog = new
>> UnrecoverableLog();
>> ExtendedTransactionManager transactionManager = new
>>
>> TransactionManagerImpl(60, transactionLog,
>> resourceManagers);
>>
>> TransactionContextManager transactionContextManager
>> = new
>> TransactionContextManager(transactionManager,
>> transactionManager);
>>
>> If you are in spring, I'd think you could use spring
>> wiring to assemble
>> this -- we use gbeans to assemble it in geronimo.
>>
>> Hope this helps
>> david jencks
>>
>>
>>> Thierry
>>>
>>>> I think that would be a good idea.  We don't
>> really
>>>> have a generic xa
>>>> wrapper because you really want to expose the
>>>> XADatasource properties
>>>> as ManagedConnectionFactory properties.  This is
>>>> really easy to do,
>>>> however: see the derby xa wrapper in geronimo.
>>>> Since there aren't all
>>>> that many xa drivers, wrapping all of them may
>> not
>>>> be an infinitely
>>>> large task.  We do have a generic Driver wrapper,
>>>> and the j2ca
>>>> framework deals just fine with local transaction
>>>> adapters.  (you don't
>>>> get xa semantics, but you don't get exceptions
>>>> either).
>>>>
>>>> Remember also that the pooling code itself is
>> inside
>>>> the
>>>> ConnectionManager implementation, thus in the
>>>> geronimo connector
>>>> module.
>>>>
>>>> A couple other comments that might be a bit
>> advanced
>>>> for now...
>>>>
>>>> One other hidden tidbit you might be interested
>> in
>>>> is, Jeremy figured
>>>> out how to make last-resource one phase commit
>>>> optimization actually
>>>> work with correct semantics if the last resource
>> is
>>>> a database and it
>>>> is used for the transaction log.  There's an
>>>> untested implementation of
>>>> this in o.a.g.connector.outbound.transactionlog.
>> I
>>>> think it could be
>>>> useful when you want to use jms and a non-xa
>>>> database.
>>>>
>>>> Also, the "bridge" stuff for container managed
>>>> security is probably a
>>>> bad idea and should be replaced by just putting
>> more
>>>> login modules into
>>>> your original login configuration.
>>>>
>>>> thanks!
>>>> david jencks
>>>>
>>>>>
>>>>>> Here's part of the cvs connection string:
>>>>>>
>> cvs.tranql.codehaus.org:/home/projects/tranql/scm
>>>>>>
>>>>>> Generally each driver really should have a
>> driver
>>>> specific class to
>>>>>> indicate which sql exceptions it throws mean
>> that
>>>> a connection is
>>>>>> dead and should be discarded.  However, no one
>>>> has actually written
>>>>>> one of these yet :-)
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> Take a look at my blog:
>>> http://templth.blogspot.com/
>>>
>>>
>>> 	
>>>
>>> 	
>>> 		
>>>
>>
> _______________________________________________________________________
>>
>>> ______
>>> Découvrez le nouveau Yahoo! Mail : 1 Go d'espace
>> de stockage pour vos
>>> mails, photos et vidéos !
>>> Créez votre Yahoo! Mail sur
>> http://fr.mail.yahoo.com
>>>
>>
>>
>
>
> Take a look at my blog:
> http://templth.blogspot.com/
>
>
> 	
>
> 	
> 		
> _______________________________________________________________________ 
> ______
> Découvrez le nouveau Yahoo! Mail : 1 Go d'espace de stockage pour vos  
> mails, photos et vidéos !
> Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com
>


Mime
View raw message