geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Dillon <>
Subject Re: Spring support in Geronimo
Date Fri, 03 Feb 2006 08:42:02 GMT
> It looks like you can be the first to test out my new  
> SpringTransactionManager :-).  It wraps our  
> TransactionContextManager in a PlatformTransactionManager  
> subclass.  You need to give it 2 constructor args, the kernel name  
> and the tcm object name.  The normal values are in the comments in  
> the class.

Aight... kick it down yo.

> What does Hibernate need?   Can it work off a spring tm or does it  
> need something else?

I think it wants a special lookup class... I wrote one up tonight  
based on comments to the dev list a while ago... creating a proxy to  
the TransactionManager instance.  I have yet to test it though.

> If you can come up with some kind of spring app that ought to work  
> and uses the spring tm I would be able to test and perhaps debug my  
> code :-)

I might be able to come up with something simple... though right now  
first priority is to just get something... anything working inside of  
Geronimo so our SE dept. can test it.

Anyways, looks like spring needs a Geronimo version like: 

I've yet to look at what this puppy does.

And Hibernate needs a Geronimo version of: 

This is what I wrote and will be testing out tomorrow.

package com.solidusnetworks.utils.geronimo;

import java.util.Properties;

import javax.transaction.TransactionManager;

import net.sf.hibernate.HibernateException;
import net.sf.hibernate.transaction.TransactionManagerLookup;

import org.apache.geronimo.kernel.Kernel;
import org.apache.geronimo.kernel.KernelRegistry;

* Provides lookup of the Geronimo (1.0) transaction manager.
* @version $Id$ $Date$
* @author <a href="">Jason Dillon</a>
public class GeronimoTransactionManagerLookup
     implements TransactionManagerLookup
     public static final String TXM_GBEAN_NAME =  
     public static final String USER_TXN_NAME = "java:comp/ 

	public TransactionManager getTransactionManager(final Properties  
props) throws HibernateException {
		try {
             // FIXME: This is probably not work when Geronimo  
versions change... :-(
             ObjectName TM_NAME = new ObjectName(TXM_GBEAN_NAME);
             Kernel kernel = KernelRegistry.getSingleKernel();
             return (TransactionManager) kernel.getProxyManager 
().createProxy(TM_NAME, TransactionManager.class);
		catch (Exception e) {
			throw new HibernateException("Failed to lookup Geronimo  
transaction manager", e);

	public String getUserTransactionName() {
		return USER_TXN_NAME;


View raw message