Hibernate 4

Pessoal, estou migrando para o Hibernate 4 e estou tendo problemas no HibernateConnectionFilter

minha classe filter:

[code]
public class ConexaoHibernateFilter implements Filter {

private SessionFactory sessionFactory;

@Override
public void destroy() {

}

@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
	try {
		this.sessionFactory.getCurrentSession().beginTransaction();
		chain.doFilter(request, response);
		this.sessionFactory.getCurrentSession().getTransaction().commit();
		this.sessionFactory.getCurrentSession().close();
	} catch (Throwable ex) {
		try {
			if (this.sessionFactory.getCurrentSession().getTransaction().isActive()) {
				this.sessionFactory.getCurrentSession().getTransaction().rollback();
			}
		} catch (Throwable t) {
			t.printStackTrace();
		}
		throw new ServletException(ex);
	}
}

@Override
public void init(FilterConfig config) throws ServletException {
	this.sessionFactory = HibernateUtil.getSessionFactory();
}

}[/code]

Se eu criar minha sesstinoFactory como abaixo, não da erro nenhum e funciona perfeitamente no hibernate 4, porem está deprecated:

/*private static final SessionFactory sessionFactory = buildSessionFactory();
	
	private static SessionFactory buildSessionFactory() {
		try {
			Configuration cfg = new Configuration();
			cfg.configure("hibernate.cfg.xml");
			return cfg.buildSessionFactory(); --> Deprecated
		} catch (Throwable e) {
			System.out.println("Criacao inicial do objeto SessionFactory falhou. Erro: " + e);
			throw new ExceptionInInitializerError(e);
		}
	} 

	public static SessionFactory getSessionFactory() {
		return sessionFactory;
	}

Se eu criar minha sesstionFactory como na documentação do hibernate 4 (segue abaixo), da erro na conexaoHibernateFilter: o erro é: createQuery is not valid without active transaction

private static SessionFactory sessionFactory;
	private static ServiceRegistry serviceRegistry; //<--- hibernate 4
	  

	   private static SessionFactory configureSessionFactory() throws HibernateException {
	       Configuration configuration = new Configuration();
	       configuration.configure();
	       serviceRegistry = new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry();        
	       sessionFactory = configuration.buildSessionFactory(serviceRegistry);
	       return sessionFactory;
	   }  
	  
	     public static SessionFactory getSessionFactory() {
	         return configureSessionFactory();
	     }
}

Alguem sabe como resolver?

Alguem consegue me ajudar?

Ninguem?

Olha isso ver se ajuda