geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thierry Templier <temp...@yahoo.fr>
Subject Integration of Geronimo modules (Tx / JCA) in Spring
Date Mon, 23 May 2005 19:15:25 GMT
Hi,

We try to use the Geronimo Transaction Manager and JCA
Connection Manager in a standalone Spring application
in order to use JCA connectors and XA Transactions
without an application server or only in a web
container (for example Tomcat...).

Although the source code of these modules is really
great (congratulations for your work), we have had
some little problems when we try to make work the
application with them. We work with the 1.0-M3 version
of Geronimo.

1°) When we try to use the Geronimo transaction
manager, we have had a NullPointerException in the
newTransaction method of the
ConnectionTrackingCoordinator class. As a matter of
fact, the oldInstanceContext instance is null whereas
we do the following thing in the
TransactionContextManagerFactoryBean class:

this.transactionContextManager.newUnspecifiedTransactionContext();

So we modify the newTransaction method as following:
public void newTransaction() throws ResourceException
{
    InstanceContext oldInstanceContext =
(InstanceContext) currentInstanceContexts.get();
    if( oldInstanceContext!=null ) {
        notifyConnections(oldInstanceContext);
    }
}

Perhaps have we not make a correct initialization of
the Transaction Manager module (TransactionManager and
TransactionContextManager). Here is the code to do
that:

//Instanciate the Geronimo extended transaction
manager
if( this.transactionManagerImpl==null ) {
    this.transactionManagerImpl=new
TransactionManagerImpl();
}

//Select a recovery support
XidFactory xidFactory=new XidFactoryImpl();
if( this.transactionLog==null ) {
    this.transactionLog=new UnrecoverableLog();
}
Recovery recovery=new
RecoveryImpl(this.transactionLog,xidFactory);

//Instanciate the transaction context manager
this.transactionContextManager=new
TransactionContextManager(this.transactionManagerImpl,
                                                   
this.transactionManagerImpl,recovery); 

this.transactionContextManager.newUnspecifiedTransactionContext();

2°) We have too an other problem. Geronimo seems to
work with the NamedXAResource interface (an interface
which extends the XAResource interface).
We make some tests with XAPool and we have a
ClassCastException if we don't wrap the XAResource we
use in a WrapperNamedXAResource class:

Transaction ntx = this.getTransaction();
...
tx.enlistResource(new
WrapperNamedXAResource(xacon.getXAResource(),"XAPool"));

Is it possible to use directly XAResource with the
Geronimo Transaction Manager?

I'll try to make our integration work with the latest
version of these modules.
Thanks for your help and your answers,
Thierry

Take a look at my blog:
http://templth.blogspot.com/


	
	
		
____________________________________________________________________________________
Le Yahoo! Messenger BETA est arrivé ! : Découvrez les appels audio illlimités et le partage
de photos facilité
Téléchargez cette version sur http://fr.messenger.yahoo.com

Mime
View raw message